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