| Total Complexity | 8 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | trait PreferTrait |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Parser used for scanning the text |
||
| 19 | * @var Parser |
||
| 20 | */ |
||
| 21 | private $preference = null; |
||
| 22 | |||
| 23 | private function pushPreferenceToContext(Context $context) |
||
| 24 | { |
||
| 25 | if ($this->preference) { |
||
| 26 | $context->pushPreference($this->preference); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | private function popPreferenceFromContext(Context $context) |
||
| 31 | { |
||
| 32 | if ($this->preference) { |
||
| 33 | $context->popPreference(); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | public function setPreference(string $preference) |
||
| 38 | { |
||
| 39 | $this->preference = $preference; |
||
|
|
|||
| 40 | |||
| 41 | return $this; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function preferShortest() |
||
| 45 | { |
||
| 46 | $this->preference = Prefer::SHORTEST; |
||
| 47 | |||
| 48 | return $this; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function preferLongest() |
||
| 56 | } |
||
| 57 | |||
| 58 | public function preferFirst() |
||
| 59 | { |
||
| 63 | } |
||
| 64 | |||
| 66 |
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..