diff --git a/src/Adapter/Composer.php b/src/Adapter/Composer.php index 83390fd3..bce2453b 100644 --- a/src/Adapter/Composer.php +++ b/src/Adapter/Composer.php @@ -174,20 +174,6 @@ public function autoload(array $autoloads): void file_put_contents($this->workdir.'/composer.json', json_encode($composer, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); } - public function install(): void - { - $this->command( - 'composer', - 'install', - '--prefer-dist', - '--no-progress', - '--prefer-stable', - '--sort-packages', - '--optimize-autoloader', - '--no-dev', - ); - } - public function addGithubRepository(string $name, string $url): void { $this->command( diff --git a/src/Adapter/Docker/Factory.php b/src/Adapter/Docker/Factory.php index 7423c025..3ba0ecfc 100644 --- a/src/Adapter/Docker/Factory.php +++ b/src/Adapter/Docker/Factory.php @@ -60,9 +60,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt } else { $builder->withComposerFile(new Packaging\Asset\LocalFile('composer.json')); } - if (file_exists('vendor')) { - $builder->withDirectory(new Packaging\Directory('vendor/')); - } } if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) { diff --git a/src/Adapter/Docker/Satellite.php b/src/Adapter/Docker/Satellite.php index a3fec7e0..48755a4a 100644 --- a/src/Adapter/Docker/Satellite.php +++ b/src/Adapter/Docker/Satellite.php @@ -15,14 +15,14 @@ final class Satellite implements Configurator\SatelliteInterface { /** @var string[] */ private array $imageTags = []; - /** @var iterable */ + /** @var iterable */ private iterable $files; private iterable $dependencies = []; public function __construct( private readonly Dockerfile\Dockerfile $dockerfile, private readonly string $workdir, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\AssetInterface|Packaging\DirectoryInterface ...$files ) { $this->files = $files; } @@ -34,7 +34,7 @@ public function addTags(string ...$imageTags): self return $this; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\AssetInterface|Packaging\DirectoryInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Adapter/Docker/SatelliteBuilder.php b/src/Adapter/Docker/SatelliteBuilder.php index 43e11363..a5b71496 100644 --- a/src/Adapter/Docker/SatelliteBuilder.php +++ b/src/Adapter/Docker/SatelliteBuilder.php @@ -164,7 +164,6 @@ public function build(): Configurator\SatelliteInterface } $dockerfile->push(new Dockerfile\PHP\Composer()); - $dockerfile->push(new Dockerfile\PHP\ComposerInstall()); } else { $dockerfile->push(new Dockerfile\PHP\Composer()); $dockerfile->push(new Dockerfile\PHP\ComposerInit(sprintf('satellite/%s', substr(hash('sha512', random_bytes(64)), 0, 64)))); diff --git a/src/Adapter/Filesystem/Factory.php b/src/Adapter/Filesystem/Factory.php index 6b7922a4..8b6be641 100644 --- a/src/Adapter/Filesystem/Factory.php +++ b/src/Adapter/Filesystem/Factory.php @@ -38,9 +38,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt new Packaging\Asset\LocalFile('composer.json'), ); } - if (file_exists('vendor')) { - $builder->withDirectory(new Packaging\Directory('vendor/')); - } } if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) { diff --git a/src/Adapter/Filesystem/Satellite.php b/src/Adapter/Filesystem/Satellite.php index 092aaadb..8c5cf280 100644 --- a/src/Adapter/Filesystem/Satellite.php +++ b/src/Adapter/Filesystem/Satellite.php @@ -11,19 +11,19 @@ final class Satellite implements Configurator\SatelliteInterface { - /** @var iterable */ + /** @var iterable */ private iterable $files; private iterable $dependencies = []; public function __construct( private readonly string $workdir, private readonly Composer $composer, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\AssetInterface|Packaging\DirectoryInterface ...$files ) { $this->files = $files; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\AssetInterface|Packaging\DirectoryInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Adapter/Filesystem/SatelliteBuilder.php b/src/Adapter/Filesystem/SatelliteBuilder.php index 5c2483e1..f8b88d27 100644 --- a/src/Adapter/Filesystem/SatelliteBuilder.php +++ b/src/Adapter/Filesystem/SatelliteBuilder.php @@ -129,8 +129,6 @@ public function build(): Configurator\SatelliteInterface if (null !== $this->composerLockFile) { $satellite->withFile($this->composerLockFile); } - - $composer->install(); } else { $composer->init(sprintf('satellite/%s', substr(hash('sha512', random_bytes(64)), 0, 64))); $composer->minimumStability('dev'); diff --git a/src/Adapter/Tar/Factory.php b/src/Adapter/Tar/Factory.php index 28a79d31..4e7a55b8 100644 --- a/src/Adapter/Tar/Factory.php +++ b/src/Adapter/Tar/Factory.php @@ -33,9 +33,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt } else { $builder->withComposerFile(new Packaging\Asset\LocalFile('composer.json')); } - if (file_exists('vendor')) { - $builder->withDirectory(new Packaging\Directory('vendor/')); - } } if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) { diff --git a/src/Adapter/Tar/Satellite.php b/src/Adapter/Tar/Satellite.php index e80c81b9..f89f8577 100644 --- a/src/Adapter/Tar/Satellite.php +++ b/src/Adapter/Tar/Satellite.php @@ -13,13 +13,13 @@ final class Satellite implements Configurator\SatelliteInterface { /** @var string[] */ private array $imageTags = []; - /** @var iterable */ + /** @var iterable */ private iterable $files; private iterable $dependencies = []; public function __construct( private readonly string $outputPath, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\AssetInterface|Packaging\DirectoryInterface ...$files ) { $this->files = $files; } @@ -31,7 +31,7 @@ public function addTags(string ...$imageTags): self return $this; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\AssetInterface|Packaging\DirectoryInterface ...$files): self { array_push($this->files, ...$files);