| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | protected function messageNotFound(): string |
||
| 39 | { |
||
| 40 | return $this->messageNotFound ?? 'Unable to find object.'; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return null |
||
| 45 | * @throws HttpException |
||
| 46 | */ |
||
| 47 | protected function handleNotFoundResponse() |
||
| 48 | { |
||
| 49 | throw new HttpException( |
||
| 50 | $this->statusCodeNotFound(), |
||
| 51 | $this->messageNotFound() |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 77 |
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: