1 | <?php |
||
13 | trait MatcherTrait |
||
14 | { |
||
15 | /** |
||
16 | * Returns whether or not the matcher is negated. A negated matcher negates |
||
17 | * the results of a match. |
||
18 | * |
||
19 | * @return bool |
||
20 | */ |
||
21 | public function isNegated() |
||
25 | |||
26 | /** |
||
27 | * Inverts a matcher. If a matcher is not negated, it will become negated. If a matcher |
||
28 | * is negated, it will no longer be negated. |
||
29 | * |
||
30 | * @return $this |
||
31 | */ |
||
32 | public function invert() |
||
38 | |||
39 | /** |
||
40 | * Set the TemplateInterface to use for formatting match results. |
||
41 | * |
||
42 | * @param TemplateInterface $template |
||
43 | * @return $this |
||
44 | */ |
||
45 | public function setTemplate(TemplateInterface $template) |
||
46 | { |
||
47 | $this->template = $template; |
||
48 | |||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Set the Assertion bound to the matcher. Useful for checking |
||
54 | * flags from within a matcher. |
||
55 | * |
||
56 | * @param Assertion $assertion |
||
57 | * @return mixed |
||
58 | */ |
||
59 | public function setAssertion(Assertion $assertion) |
||
65 | |||
66 | /** |
||
67 | * @var bool |
||
68 | */ |
||
69 | protected $negated = false; |
||
70 | |||
71 | /** |
||
72 | * @var TemplateInterface |
||
73 | */ |
||
74 | protected $template; |
||
75 | |||
76 | /** |
||
77 | * @var Assertion |
||
78 | */ |
||
79 | protected $assertion; |
||
80 | } |
||
81 |