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