| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 67 | */ |
||
| 68 | 1 | public function find(string $id) |
|
| 69 | { |
||
| 70 | 1 | $provinceId = substr($id, 0, 2); |
|
| 71 | 1 | $districtId = substr($id, 2, 2); |
|
| 72 | 1 | foreach (NativeApi::getInstance()->PobierzListePowiatow($provinceId) as $i) { |
|
| 73 | 1 | if ($i->districtId === $districtId) { |
|
| 74 | 1 | $this->id = $id; |
|
| 75 | 1 | $this->name = $i->name; |
|
|
|
|||
| 76 | 1 | $this->typeName = $i->typeName; |
|
| 77 | } |
||
| 78 | } |
||
| 79 | 1 | if (!$this->id) { |
|
| 80 | throw new NotFound(sprintf('District [id:%s] not exists', $id)); |
||
| 81 | } |
||
| 82 | 1 | $this->province = (new Province())->find($provinceId); |
|
| 88 |
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..