With Matcher you can match an object to specified rules and get data returned.

Example usage

// Add some rules
$matcher->whenProperty('title')->contains('Hi')->provide(['foo' => 'bar']);

// Get an object to match against
$object = Your\Object;
$object->title = 'Hi';

// Check if the object matches the rules
$data = $matcher->match($object); // Will return "array(array('foo' => 'bar'))"

Rule logic

Every rule can match using different logics. For now, these are the implemented logics:

// Applied the a Rule object
$rule->equals('foo'); // Default logic

//Applied to a Container object using the fluent interface

Documentation will be updated with:

  • Using tags
  • Unique fields
  • Match logic explained
  • Match against multiple values
  • Setting default values
  • Helpful scenarios when you can use this library