Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function find(): SplFileInfo |
||
44 | { |
||
45 | $this->symfonyFinder->files() |
||
46 | ->in($this->filesystem->getCurrentWorkingDirectory()) |
||
47 | ->name('dandelion.json') |
||
48 | ->depth('== 0'); |
||
49 | |||
50 | if ($this->symfonyFinder->count() !== 1) { |
||
51 | throw new ConfigurationFileNotFoundException('Configuration "dandelion.json" not found.'); |
||
52 | } |
||
53 | |||
54 | $iterator = $this->symfonyFinder->getIterator(); |
||
55 | $iterator->rewind(); |
||
56 | |||
57 | if (!$iterator->valid()) { |
||
58 | throw new RuntimeException('Current position is not valid.'); |
||
59 | } |
||
60 | |||
61 | return $iterator->current(); |
||
62 | } |
||
64 |