| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 81 | public static function fromErrorResponse(Response $response) : self |
|
| 31 | { |
||
| 32 | 81 | $self = new self( |
|
| 33 | 81 | $response->getBodyField(Keys::ERROR_24), |
|
| 34 | 81 | $response->getCode() & (Response::TYPE_ERROR - 1) |
|
| 35 | ); |
||
| 36 | |||
| 37 | 81 | if ($error = $response->tryGetBodyField(Keys::ERROR)) { |
|
| 38 | 81 | $self->error = Error::fromMap($error); |
|
|
|
|||
| 39 | } |
||
| 40 | |||
| 41 | 81 | return $self; |
|
| 42 | } |
||
| 43 | |||
| 54 |
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..