1 | <?php |
||
7 | class BasicAuthRestricter extends Restricter |
||
8 | { |
||
9 | /** |
||
10 | * Do we need to restric. |
||
11 | */ |
||
12 | public function isRestrictionEnabled() |
||
16 | |||
17 | /** |
||
18 | * Protection method. |
||
19 | * |
||
20 | * @return Response|bool |
||
21 | */ |
||
22 | public function restrict() |
||
34 | |||
35 | /** |
||
36 | * Attempt login. |
||
37 | * |
||
38 | * @return bool |
||
39 | * |
||
40 | * @throws \Exception |
||
41 | */ |
||
42 | protected function attempt() |
||
55 | |||
56 | /** |
||
57 | * Returns www-authenticate header. |
||
58 | * |
||
59 | * @return Response |
||
60 | */ |
||
61 | protected function getBasicAuthenticationResponse() |
||
67 | |||
68 | /** |
||
69 | * PHP FPM / FastCGI Compatibility |
||
70 | * use custom headers. |
||
71 | */ |
||
72 | protected function ensurePhpFpmCompatibility() |
||
77 | |||
78 | /** |
||
79 | * Set headers. |
||
80 | * |
||
81 | * @param $header |
||
82 | */ |
||
83 | protected function tryToSetAuthPHPFrom($header) |
||
96 | } |
||
97 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: