1 | <?php |
||
12 | abstract class AbstractMatcher implements MatcherInterface |
||
13 | { |
||
14 | use MatcherTrait; |
||
15 | |||
16 | /** |
||
17 | * @param mixed $expected |
||
18 | */ |
||
19 | public function __construct($expected) |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | * |
||
27 | * @param mixed $actual |
||
28 | * @return Match |
||
29 | */ |
||
30 | public function match($actual = '') |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @return TemplateInterface |
||
42 | */ |
||
43 | public function getTemplate() |
||
51 | |||
52 | /** |
||
53 | * The actual matching algorithm for the matcher. This is called by ->match() |
||
54 | * to create a Match result. |
||
55 | * |
||
56 | * @param mixed $actual |
||
57 | * @return bool |
||
58 | */ |
||
59 | abstract protected function doMatch($actual); |
||
60 | |||
61 | /** |
||
62 | * @var mixed |
||
63 | */ |
||
64 | protected $expected; |
||
65 | } |
||
66 |