1 | <?php |
||
9 | class VerifyApiToken |
||
10 | { |
||
11 | /** |
||
12 | * The Token instance. |
||
13 | * |
||
14 | * @var \ElfSundae\Laravel\Api\Token |
||
15 | */ |
||
16 | protected $token; |
||
17 | |||
18 | /** |
||
19 | * The URIs that should be excluded from token verification. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $except = []; |
||
24 | |||
25 | /** |
||
26 | * Create the middleware. |
||
27 | * |
||
28 | * @param \ElfSundae\Laravel\Api\Token $token |
||
29 | */ |
||
30 | public function __construct(Token $token) |
||
34 | |||
35 | /** |
||
36 | * Handle an incoming request. |
||
37 | * |
||
38 | * @param \Illuminate\Http\Request $request |
||
39 | * @param \Closure $next |
||
40 | * @return mixed |
||
41 | * |
||
42 | * @throws \ElfSundae\Laravel\Api\Exceptions\InvalidApiTokenException |
||
43 | */ |
||
44 | public function handle($request, Closure $next) |
||
57 | |||
58 | /** |
||
59 | * Determine if the request has a URI that should be passed through verification. |
||
60 | * |
||
61 | * @param \Illuminate\Http\Request $request |
||
62 | * @return bool |
||
63 | */ |
||
64 | protected function inExceptArray($request) |
||
78 | |||
79 | /** |
||
80 | * Verify the api token from request. |
||
81 | * |
||
82 | * @param \Illuminate\Http\Request $request |
||
83 | * @return bool |
||
84 | */ |
||
85 | protected function verifyToken($request) |
||
93 | |||
94 | /** |
||
95 | * Get the app key from the request. |
||
96 | * |
||
97 | * @param \Illuminate\Http\Request $request |
||
98 | * @return string |
||
99 | */ |
||
100 | protected function getKeyFromRequest($request) |
||
104 | |||
105 | /** |
||
106 | * Set current app key for the request. |
||
107 | * |
||
108 | * @param \Illuminate\Http\Request $request |
||
109 | */ |
||
110 | protected function setCurrentAppKeyForRequest($request) |
||
114 | } |
||
115 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.