1 | <?php |
||
23 | abstract class MatcherAbstract |
||
24 | { |
||
25 | /** |
||
26 | * The expected value (or part thereof) |
||
27 | * |
||
28 | * @var mixed |
||
29 | */ |
||
30 | protected $_expected = null; |
||
31 | |||
32 | /** |
||
33 | * Set the expected value |
||
34 | * |
||
35 | * @param mixed $expected |
||
36 | */ |
||
37 | 310 | public function __construct($expected = null) |
|
41 | |||
42 | /** |
||
43 | * Check if the actual value matches the expected. |
||
44 | * Actual passed by reference to preserve reference trail (where applicable) |
||
45 | * back to the original method parameter. |
||
46 | * |
||
47 | * @param mixed $actual |
||
48 | * @return bool |
||
49 | */ |
||
50 | abstract public function match(&$actual); |
||
51 | |||
52 | /** |
||
53 | * Return a string representation of this Matcher |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | abstract public function __toString(); |
||
58 | } |
||
59 |