Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
php: ['8.4']
symfony_version: ['8.0.*']
symfony_version: ['6.4.*', '7.0.*', '7.4.*', '8.0.*']

name: PHP ${{ matrix.php }} Symfony ${{ matrix.symfony_version }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.sh
.phpunit.cache
composer.lock
config/reference.php
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"phpunit/phpunit": "^12.1",
"psalm/plugin-phpunit": "^0.19.5",
"psalm/plugin-symfony": "^5.2",
"symfony/framework-bundle": "^8.0",
"symfony/phpunit-bridge": "^8.0",
"symfony/framework-bundle": "^6.4 || ^7.0 || ^7.4 || ^8.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0 || ^7.4 || ^8.0",
"vimeo/psalm": "^6"
},
"autoload": {
Expand Down
9 changes: 9 additions & 0 deletions src/Command/Doctrine/ContextRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use function explode;
use function implode;
use function ksort;
use function method_exists;
use function sprintf;
use function trim;

Expand All @@ -53,6 +54,14 @@ public function getConfiguration(): Configuration

public function configure(Command $wrapper, Command $innerCommand): void
{
if (method_exists($wrapper, 'getCode') && $wrapper->getCode() !== null) {
throw new InvalidArgumentException(sprintf('The CLI command "%s" is not expected to use custom execution code', $wrapper::class));
}

if (method_exists($innerCommand, 'getCode') && $innerCommand->getCode() !== null) {
throw new InvalidArgumentException(sprintf('The CLI command "%s" is not expected to use custom execution code', $innerCommand::class));
}

$name = $wrapper->getName() ?? $innerCommand->getName();
if ($name !== null) {
$wrapper->setName($name);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Database/CreateDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
private readonly CreateDatabaseDoctrineCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Mapping/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\ORM\Tools\Console\Command\InfoCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/CurrentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\CurrentCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\DiffCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/DumpSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\DumpSchemaCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\ExecuteCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\GenerateCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/LatestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\LatestCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\ListCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\MigrateCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/RollupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\RollupCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\StatusCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/SyncMetadataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\SyncMetadataCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/UpToDateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\UpToDateCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Migrations/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\Migrations\Tools\Console\Command\VersionCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Schema/CreateSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
private readonly CreateCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Doctrine/Schema/ValidateSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private readonly \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand $command,
private readonly ContextRunner $contextRunner,
) {
parent::__construct($this->command->getName(), $this->command->getCode());
parent::__construct($this->command->getName());
}

#[Override]
Expand Down
Loading