1 | <?php |
||
16 | class AssetsBuilder |
||
17 | { |
||
18 | |||
19 | |||
20 | /** |
||
21 | * @var InstallationManager |
||
22 | */ |
||
23 | private $installationManager; |
||
24 | /** |
||
25 | * @var IOInterface |
||
26 | */ |
||
27 | private $io; |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $rootDir; |
||
32 | |||
33 | public function __construct(InstallationManager $installationManager, IOInterface $io, string $rootDir) |
||
39 | |||
40 | /** |
||
41 | * Find discovery.json files in the passed repository and builds an asset type. |
||
42 | * |
||
43 | * @param RepositoryInterface $repository |
||
44 | * @return AssetType[] |
||
45 | */ |
||
46 | public function findAssetTypes(RepositoryInterface $repository) : array |
||
62 | |||
63 | /** |
||
64 | * Builds the AssetTypes that will be exported in the generated TheCodingMachine\Discovery class. |
||
65 | * |
||
66 | * @param PackageInterface[] $discoveryPackages |
||
67 | * |
||
68 | * @return AssetType[] An array of AssetType, indexed by asset type name. |
||
69 | */ |
||
70 | public function buildAssetTypes(array $discoveryPackages) : array |
||
94 | |||
95 | /** |
||
96 | * Returns the parsed JSON of the discovery.json file of a package. |
||
97 | * |
||
98 | * @param PackageInterface $package |
||
99 | * |
||
100 | * @return AssetOperation[][] |
||
101 | * |
||
102 | * @throws \TheCodingMachine\Discovery\Utils\JsonException |
||
103 | */ |
||
104 | private function getDiscoveryJson(PackageInterface $package) : array |
||
118 | } |
||
119 |