Total Complexity | 8 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | trait PreferTrait |
||
15 | { |
||
16 | /** |
||
17 | * Parser used for scanning the text. |
||
18 | * |
||
19 | * @var Parser |
||
20 | */ |
||
21 | private $preference = null; |
||
22 | |||
23 | 104 | private function pushPreferenceToContext(Context $context) |
|
24 | { |
||
25 | 104 | if ($this->preference) { |
|
26 | 36 | $context->pushPreference($this->preference); |
|
27 | } |
||
28 | 104 | } |
|
29 | |||
30 | 104 | private function popPreferenceFromContext(Context $context) |
|
34 | } |
||
35 | 104 | } |
|
36 | |||
37 | /** |
||
38 | * @param string $preference |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | 1 | public function setPreference($preference) |
|
43 | { |
||
44 | 1 | $this->preference = $preference; |
|
|
|||
45 | |||
46 | 1 | return $this; |
|
47 | } |
||
48 | |||
49 | 1 | public function preferShortest() |
|
50 | { |
||
51 | 1 | $this->preference = Prefer::SHORTEST; |
|
52 | |||
53 | 1 | return $this; |
|
54 | } |
||
55 | |||
56 | 2 | public function preferLongest() |
|
61 | } |
||
62 | |||
63 | 1 | public function preferFirst() |
|
70 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..