Conditions | 5 |
Paths | 5 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __construct(string $expressionString = '') |
||
25 | { |
||
26 | $expressions = explode( |
||
27 | ',', |
||
28 | str_replace(' ', '', $expressionString) |
||
29 | ); |
||
30 | |||
31 | foreach ($expressions as $expr) { |
||
32 | if (empty($expr)) { |
||
33 | continue; |
||
34 | } |
||
35 | if (ctype_digit($expr)) { |
||
36 | $this->addPage((int)$expr); |
||
37 | continue; |
||
38 | } |
||
39 | if (preg_match("/^(\d+)-(\d+)/", $expr, $matches)) { |
||
40 | $this->addRange((int)$matches[1], (int)$matches[2]); |
||
41 | continue; |
||
42 | } |
||
43 | throw new Exception("Invalid page number(s) for expression '$expr'"); |
||
44 | } |
||
45 | } |
||
46 | |||
68 |
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..