| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 40 | public function fetchDependencies(RepositoryManager $repositoryManager, Project $project): array |
||
| 41 | { |
||
| 42 | $fileContent = $repositoryManager->getFileContents($project, $this->packageFileName); |
||
| 43 | |||
| 44 | if (is_array($fileContent) && !empty($fileContent)) { |
||
| 45 | $lines = explode("\n", $fileContent); |
||
| 46 | |||
| 47 | $dependencies = []; |
||
| 48 | foreach ($lines as $line) { |
||
| 49 | $chunks = explode('==', $line); |
||
| 50 | if (count($chunks) == 2) { |
||
| 51 | $dependencies[$chunks[0]] = $chunks[1]; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | return $dependencies; |
||
| 56 | } |
||
| 57 | |||
| 58 | return []; |
||
| 59 | } |
||
| 60 | |||
| 71 |