Conditions | 2 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function handle(Request $request, Closure $next, string $guard = null): mixed |
||
|
|||
23 | { |
||
24 | $version = Cache::remember( |
||
25 | 'Packagist.version', |
||
26 | config('xetaravel.site.packagist_cache_timeout'), |
||
27 | function () { |
||
28 | $client = new Client(); |
||
29 | $res = $client->request('GET', config('xetaravel.site.packagist_url')); |
||
30 | if ($res->getStatusCode() !== 200) { |
||
31 | return false; |
||
32 | } |
||
33 | |||
34 | $array = json_decode($res->getBody()->getContents(), true); |
||
35 | |||
36 | return $array['packages']['xetaio/xetaravel'][0]['version']; |
||
37 | } |
||
38 | ); |
||
39 | |||
40 | config(['xetaravel.version' => $version]); |
||
41 | |||
42 | return $next($request); |
||
43 | } |
||
45 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.