1: <?php
2: /**
3: * Represents a collection of constraints, if one is false, this collection will
4: * evaluate to false
5: *
6: * Based on PHPUnit_Framework_Constraint_And
7: *
8: * @author James Pepin <james@jamespepin.com>
9: */
10: class Horde_Constraint_And extends Horde_Constraint_Coupler
11: {
12: public function evaluate($value)
13: {
14: foreach ($this->_constraints as $c) {
15: if (!$c->evaluate($value)) {
16: return false;
17: }
18: }
19: return true;
20: }
21: }
22: