1 | <?php |
||
2 | /** |
||
3 | * TrustProxies.php |
||
4 | * Copyright (c) 2017 [email protected] |
||
5 | * |
||
6 | * This file is part of Firefly III. |
||
7 | * |
||
8 | * Firefly III is free software: you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU General Public License as published by |
||
10 | * the Free Software Foundation, either version 3 of the License, or |
||
11 | * (at your option) any later version. |
||
12 | * |
||
13 | * Firefly III is distributed in the hope that it will be useful, |
||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
16 | * GNU General Public License for more details. |
||
17 | * |
||
18 | * You should have received a copy of the GNU General Public License |
||
19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
||
20 | */ |
||
21 | declare(strict_types=1); |
||
22 | |||
23 | namespace FireflyIII\Http\Middleware; |
||
24 | |||
25 | use Fideloper\Proxy\TrustProxies as Middleware; |
||
26 | use Illuminate\Contracts\Config\Repository; |
||
27 | use Illuminate\Http\Request; |
||
28 | |||
29 | /** |
||
30 | * Class TrustProxies |
||
31 | * |
||
32 | * @codeCoverageIgnore |
||
33 | */ |
||
34 | class TrustProxies extends Middleware |
||
35 | { |
||
36 | /** @var int The headers to check. */ |
||
37 | protected $headers = Request::HEADER_X_FORWARDED_ALL; |
||
38 | |||
39 | /** |
||
40 | * TrustProxies constructor. |
||
41 | * |
||
42 | * @param Repository $config |
||
43 | */ |
||
44 | public function __construct(Repository $config) |
||
45 | { |
||
46 | $trustedProxies = (string)env('TRUSTED_PROXIES', null); |
||
47 | $this->proxies = explode(',', $trustedProxies); |
||
48 | if ($trustedProxies === '**') { |
||
49 | $this->proxies = '**'; |
||
0 ignored issues
–
show
|
|||
50 | } |
||
51 | parent::__construct($config); |
||
52 | } |
||
53 | } |
||
54 |
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..