| Conditions | 4 |
| Paths | 6 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | 13 | private function isSecured(Request $request) |
|
| 25 | { |
||
| 26 | 13 | $secured = FALSE; |
|
| 27 | 13 | foreach ($request->getHeader(self::SECRET_HEADER) as $secret) { |
|
| 28 | 11 | if ($secret == $this->secret) { // allow cast |
|
|
|
|||
| 29 | 11 | $secured = TRUE; |
|
| 30 | 11 | } |
|
| 31 | 13 | } |
|
| 32 | |||
| 33 | 13 | return $this->secret === NULL || $secured; |
|
| 34 | } |
||
| 35 | |||
| 37 |
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: