| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 28 | public function getPhpFiles(string $path): FileCollection |
||
| 29 | { |
||
| 30 | $directoryIterator = new RecursiveDirectoryIterator($path); |
||
| 31 | $files = new FileCollection; |
||
| 32 | foreach (new RecursiveIteratorIterator($directoryIterator) as $file) { |
||
| 33 | if ($file->getExtension() !== 'php') { |
||
| 34 | continue; |
||
| 35 | } |
||
| 36 | |||
| 37 | if (in_array($file->getPathname(), $this->config->getFilesToIgnore())) { |
||
| 38 | continue; |
||
| 39 | } |
||
| 40 | |||
| 41 | $files->push(new File(['displayPath' => $file->getPathName(), 'fullPath' => $file->getRealPath()])); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $files; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
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: