1 | <?php |
||
11 | class TokenCan |
||
12 | { |
||
13 | /** |
||
14 | * @var UserTokenRepository |
||
15 | */ |
||
16 | private $userToken; |
||
17 | /** |
||
18 | * @var Authentication |
||
19 | */ |
||
20 | private $auth; |
||
21 | |||
22 | public function __construct(UserTokenRepository $userToken, Authentication $auth) |
||
27 | |||
28 | /** |
||
29 | * @param Request $request |
||
30 | * @param \Closure $next |
||
31 | * @param string $permission |
||
32 | * @return Response |
||
33 | */ |
||
34 | public function handle(Request $request, \Closure $next, $permission) |
||
48 | |||
49 | /** |
||
50 | * @param string $token |
||
51 | * @return UserInterface |
||
52 | */ |
||
53 | private function getUserFromToken($token) |
||
59 | |||
60 | /** |
||
61 | * @param string $token |
||
62 | * @return string |
||
63 | */ |
||
64 | private function parseToken($token) |
||
68 | } |
||
69 |
This check looks at variables that 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.