| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Dependencies |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Retrieve a DependencyService for a single package. |
||
| 12 | * |
||
| 13 | * @param string $type |
||
| 14 | * @param string $package |
||
| 15 | * @return DependencyService |
||
| 16 | */ |
||
| 17 | public static function from(string $type, string $package): DependencyService |
||
| 18 | { |
||
| 19 | return new DependencyService($package, $type); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Retrieve dependencies from the composer.json file & optionally include 'dev' dependencies. |
||
| 24 | * |
||
| 25 | * @param bool $devComposerDependencies |
||
| 26 | * @return DependenciesRepository |
||
| 27 | */ |
||
| 28 | public static function fromComposer(bool $devComposerDependencies = false): DependenciesRepository |
||
| 29 | { |
||
| 30 | return (new DependenciesRepository())->fromComposer($devComposerDependencies); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Retrieve dependencies from the config file. |
||
| 35 | * |
||
| 36 | * @return DependenciesRepository |
||
| 37 | */ |
||
| 38 | public static function fromConfig(): DependenciesRepository |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Retrieve dependencies from an array. |
||
| 45 | * |
||
| 46 | * @param array $dependencies |
||
| 47 | * @return DependenciesRepository |
||
| 48 | */ |
||
| 49 | public static function fromArray(array $dependencies): DependenciesRepository |
||
| 54 |