| Conditions | 3 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 64 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
| 65 | { |
||
| 66 | 1 | $this->consumerToken = $accessToken; |
|
|
|
|||
| 67 | |||
| 68 | 1 | $result = $this->request( |
|
| 69 | 1 | 'GET', |
|
| 70 | 1 | 'users', |
|
| 71 | 1 | [], |
|
| 72 | $accessToken |
||
| 73 | ); |
||
| 74 | |||
| 75 | 1 | if (!isset($result['user']) || !$result['user']) { |
|
| 76 | throw new InvalidResponse( |
||
| 77 | 'API response without user inside JSON' |
||
| 78 | ); |
||
| 79 | } |
||
| 80 | |||
| 81 | 1 | $hydrator = new ArrayHydrator([ |
|
| 82 | 1 | 'id' => 'id', |
|
| 83 | 'name' => 'name', |
||
| 84 | ]); |
||
| 85 | |||
| 86 | 1 | return $hydrator->hydrate(new User(), $result['user']); |
|
| 87 | } |
||
| 89 |
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..