Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
17 | public function discoverFiles(string $fromDirectory): array |
||
18 | { |
||
19 | $currentDirectory = $fromDirectory; |
||
20 | do { |
||
21 | $globResult = glob($currentDirectory . '/' . self::VALID_FILE_NAME_GLOB); |
||
22 | |||
23 | if (count($globResult)) { |
||
24 | return [ $this->preferNonDistributionFiles($globResult) ]; |
||
25 | } |
||
26 | |||
27 | $currentDirectory = dirname($currentDirectory); |
||
28 | } while ($currentDirectory !== '/'); |
||
29 | |||
30 | throw new \RuntimeException('No config file found, make sure you have created a .psh file'); |
||
31 | } |
||
32 | |||
48 |