Skip to content

Commit

Permalink
feat(composer): composer.castor.json -> castor.composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwurtz committed Apr 22, 2024
1 parent 19f017b commit 574b2dd
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.castor.stub.php
/.php-cs-fixer.cache
/.phpunit.cache
/castor.*
/my-app.*
/var/
/vendor/
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Console/Command/ComposerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$vendorDirectory = $this->rootDir . Composer::VENDOR_DIR;

if (!file_exists($file = $this->rootDir . '/composer.castor.json') && !file_exists($file = $this->rootDir . '/.castor/composer.castor.json')) {
if (!file_exists($file = $this->rootDir . '/castor.composer.json') && !file_exists($file = $this->rootDir . '/.castor/castor.composer.json')) {
// Default to the root directory (so someone can do a composer init by example)
$file = $this->rootDir . '/composer.castor.json';
$file = $this->rootDir . '/castor.composer.json';
}

$composer->run($file, $vendorDirectory, $extra, $output, true);
Expand Down
4 changes: 2 additions & 2 deletions src/Import/Remote/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function install(string $entrypointDirectory, bool $update = false, bool
{
$vendorDirectory = $entrypointDirectory . self::VENDOR_DIR;

if (!file_exists($file = $entrypointDirectory . '/composer.castor.json') && !file_exists($file = $entrypointDirectory . '/.castor/composer.castor.json')) {
$this->logger->debug(sprintf('The composer.castor.json file does not exists in %s or %s/.castor, skipping composer install.', $entrypointDirectory, $entrypointDirectory));
if (!file_exists($file = $entrypointDirectory . '/castor.composer.json') && !file_exists($file = $entrypointDirectory . '/.castor/castor.composer.json')) {
$this->logger->debug(sprintf('The castor.composer.json file does not exists in %s or %s/.castor, skipping composer install.', $entrypointDirectory, $entrypointDirectory));

return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Import/Remote/PackageImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function importFromPackage(string $scheme, string $package, ?string $file
$packageDirectory = PathHelper::getRoot() . Composer::VENDOR_DIR . $package;

if (!file_exists($packageDirectory)) {
throw new ImportError(sprintf('The package "%s" is not installed, make sure you required it in your composer.castor.json file.', $package));
throw new ImportError(sprintf('The package "%s" is not installed, make sure you required it in your castor.composer.json file.', $package));
}

$this->kernel->addMount(new Mount(
Expand Down
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ function http_client(): HttpClientInterface
function import(string $path, ?string $file = null, ?string $version = null, ?string $vcs = null, ?array $source = null): void
{
if (null !== $version || null !== $vcs || null !== $source) {
@trigger_deprecation('castor/castor', '0.16.0', 'The "version", "vcs" and "source" arguments are deprecated, use the `composer.castor.json` file instead.');
@trigger_deprecation('castor/castor', '0.16.0', 'The "version", "vcs" and "source" arguments are deprecated, use the `castor.composer.json` file instead.');
}

Container::get()->importer->import($path, $file);
Expand Down
4 changes: 2 additions & 2 deletions tests/Generated/ImportComposerNotExistingTest.php.err.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
In castor.php line 5:

Could not import "foo/bar" in ".../tests/fixtures/broken/import-composer-not-existing/castor.php" on line 5. Reason: The package "foo/bar" is not installed, make sure you required it in your composer-castor.json file.
Could not import "foo/bar" in ".../tests/fixtures/broken/import-composer-not-existing/castor.php" on line 5. Reason: The package "foo/bar" is not installed, make sure you required it in your castor.composer.json file.


In PackageImporter.php line XXXX:

The package "foo/bar" is not installed, make sure you required it in your composer-castor.json file.
The package "foo/bar" is not installed, make sure you required it in your castor.composer.json file.


4 changes: 2 additions & 2 deletions tests/Generated/ImportInvalidPackageTest.php.err.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
In castor.php line 5:

Could not import "foo/bar" in ".../tests/fixtures/broken/import-invalid-package/castor.php" on line 5. Reason: The package "foo/bar" is not installed, make sure you required it in your composer-castor.json file.
Could not import "foo/bar" in ".../tests/fixtures/broken/import-invalid-package/castor.php" on line 5. Reason: The package "foo/bar" is not installed, make sure you required it in your castor.composer.json file.


In PackageImporter.php line XXXX:

The package "foo/bar" is not installed, make sure you required it in your composer-castor.json file.
The package "foo/bar" is not installed, make sure you required it in your castor.composer.json file.


0 comments on commit 574b2dd

Please sign in to comment.