| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 6 | public function __invoke( PdoAddressInterface $address ) : int |
|
| 29 | { |
||
| 30 | 6 | if (!$id = $address->getId()) |
|
| 31 | 2 | throw new \UnexpectedValueException("Addess object 'getId' did not return primary key value"); |
|
| 32 | |||
| 33 | 4 | $result = $this->stmt->execute([ |
|
| 34 | 4 | 'id' => $id |
|
| 35 | ]); |
||
| 36 | |||
| 37 | 4 | if (!$result) { |
|
| 38 | 2 | $msg = sprintf("Could not execute PDOStatement for address ID '%s'", $id); |
|
| 39 | 2 | throw new \RuntimeException($msg); |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | return $this->stmt->rowCount(); |
|
| 43 | } |
||
| 44 | } |
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..