1: <?php
2: /**
3: * Checks for an instance of a class
4: *
5: * Based on PHPUnit_Framework_Constraint_IsInstanceOf
6: *
7: * @author James Pepin <james@jamespepin.com>
8: */
9: class Horde_Constraint_IsInstanceOf implements Horde_Constraint
10: {
11: private $_type;
12:
13: public function __construct($type)
14: {
15: $this->_type = $type;
16: }
17:
18: public function evaluate($value)
19: {
20: return $value instanceof $this->_type;
21: }
22: }
23: