| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function __invoke( AddressInterface $address ) : int |
||
| 35 | { |
||
| 36 | $result = $this->stmt->execute([ |
||
| 37 | 'type' => $address->getType(), |
||
| 38 | 'street1' => $address->getStreet1(), |
||
| 39 | 'street2' => $address->getStreet2(), |
||
| 40 | 'zip' => $address->getZip(), |
||
| 41 | 'location' => $address->getLocation(), |
||
| 42 | 'country' => $address->getCountry() |
||
| 43 | ]); |
||
| 44 | |||
| 45 | if (!$result) { |
||
| 46 | $msg = sprintf("Could not execute PDOStatement for inserting address"); |
||
| 47 | throw new \RuntimeException($msg); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $this->pdo->lastInsertId(); |
||
| 51 | } |
||
| 52 | } |
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..