2017 © Pedro Peláez
 

library mute8

A text mutator that should permit random mutations.

image

derrikeg/mute8

A text mutator that should permit random mutations.

  • Monday, October 23, 2017
  • by DerrikeG
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Mute8

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., (*1)

Download

Mute8 is also available on packagist to include in your composer.json., (*2)

Usage

After downloading the package and installing it (generating its autoloader), you should be able to do the following:, (*3)

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;

Should produce: "BIRDS love noodles!", (*4)

Extending

Everything is either a Mutator or a Selector, to make a new one you can either extend the base classes or one of their sub-types. (mutator, selector), (*5)

Demo Results

Demo Example Demo Closeup, (*6)

The Versions

23/10 2017

dev-master

9999999-dev

A text mutator that should permit random mutations.

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar DerrikeG