| Total Complexity | 4 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class FileChecker |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Checks whether a file exists. |
||
| 24 | */ |
||
| 25 | public function checkFileExists(string $file, string $message = 'File "%s" not found!') |
||
| 26 | { |
||
| 27 | $exceptionMessage = (false !== strpos($message, '%s')) ? sprintf($message, $file) : $message; |
||
| 28 | |||
| 29 | if (!file_exists($file)) { |
||
| 30 | throw new FileNotFoundException($exceptionMessage); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Checks whether a PDF file exists. |
||
| 36 | */ |
||
| 37 | public function checkPdfFileExists(string $file) |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.