A text mutator that should permit random mutations.
Mutate strings using the magic of PHP. The project was designed such that an RNG could make its own selections and apply multiple "mutations" to text. In order to allow picking parts, Selectors make a string more workable by specifying which regions in a substring should be modified. Mutators then take those regions and perform transformations either by modifying, replacing, or adding to the whole or parts of a selection. By breaking it up into these two techniques it becomes a bit easier to apply partial filters to existing text and stack mutations.
Mute8 is also available on packagist to include in your composer.json.
After downloading the package and installing it (generating its autoloader), you should be able to do the following:
use DerrikeG\Mute8\Mutators\Custom\UpperCase; use DerrikeG\Mute8\Selectors\Words\FirstWord; $selector = new FirstWord("birds love noodles!"); $mutator = new UpperCase($selector); $results = $mutator->mutate(); echo $results;
"BIRDS love noodles!"