1 | <?php |
||
19 | class AuthUserSerializer extends UserSerializer |
||
20 | { |
||
21 | /** |
||
22 | * @var TokenAuth |
||
23 | */ |
||
24 | private $tokenAuth; |
||
25 | |||
26 | /** |
||
27 | * AuthUserSerializer constructor. |
||
28 | * @param TokenAuth $tokenAuth |
||
29 | */ |
||
30 | public function __construct(TokenAuth $tokenAuth) |
||
34 | |||
35 | /** |
||
36 | * @param User|Model $user |
||
37 | * @return array |
||
38 | */ |
||
39 | public function toArray($user): array |
||
45 | } |
||
46 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.