bobthecow/Ruler — pull request #20 by ludicruz (2013-12-09 23:19:04+00:00)
Title: initial implementation of set operators

Here is an example of using set operators (from the testComplicated SetTest)

```php
$rb = new RuleBuilder();
$context = new Context(array(
'expected' => 'a',
'foo' => array('a', 'z'),
'bar' => array('z', 'b'),
'baz' => array('a', 'z', 'b', 'q'),
));

$rb->create(
$rb['foo']->intersect(
$rb['bar']->symmetricDifference($rb['baz'])
)->setContains($rb['expected']),
function () {
echo "awesome sauce!\n";
}
)->execute($context);
```

Also, I switched up the contains operator a bit. (I wasn't using it before and otherwise I would have said something :) )

I think it makes sense to keep the builder contains operators as (haystack, needle) for both even though the underlying implementations, strpos and in_array, are different. this way when you're using the builder it makes more semantic sense:

```php
$rb['haystack']->setContains($rb['needle']);
$rb['haystack']->stringContains($rb['needle']);
```