1 | <?php |
||
13 | class Security extends AbstractMiddleware |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private $allowedUrls; |
||
20 | |||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | private $debug; |
||
25 | |||
26 | /** |
||
27 | * @Inject({"%application.allowed_urls%", "%debug%"}) |
||
28 | * @param array $allowedUrls |
||
29 | * @param bool $debug |
||
30 | */ |
||
31 | 3 | public function __construct(array $allowedUrls, bool $debug) |
|
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 3 | public function processResponse(Request $request, Response $response) |
|
53 | |||
54 | /** |
||
55 | * @param Request $request |
||
56 | * @return string |
||
57 | */ |
||
58 | 2 | protected function getContentSecurityPolicy(Request $request) : string |
|
86 | } |
||
87 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: