Skip to content

Commit

Permalink
Merge pull request #382 from doctrine/revert-bc-break
Browse files Browse the repository at this point in the history
revert BC break with command return types
  • Loading branch information
dbu authored May 24, 2023
2 parents 322df15 + 208aeb3 commit c59d744
Show file tree
Hide file tree
Showing 25 changed files with 197 additions and 48 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

2.4.3
-----

* Revert BC break with command return types. If you extend the commands, you should add return type declarations anyways to be ready for 3.x.

2.4.2
-----

Expand Down
10 changes: 8 additions & 2 deletions src/Command/LoadFixtureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class LoadFixtureCommand extends Command
{
use ContainerAwareTrait;

protected function configure(): void
/**
* @return void
*/
protected function configure()
{
$this
->setName('doctrine:phpcr:fixtures:load')
Expand Down Expand Up @@ -62,7 +65,10 @@ protected function configure(): void
);
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$dmName = $input->getOption('dm'); // defaults to null
DoctrineCommandHelper::setApplicationDocumentManager(
Expand Down
10 changes: 8 additions & 2 deletions src/Command/MigratorMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class MigratorMigrateCommand extends Command
{
use ContainerAwareTrait;

protected function configure(): void
/**
* @return void
*/
protected function configure()
{
$this
->setName('doctrine:phpcr:migrator:migrate')
Expand All @@ -29,7 +32,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public function setConsoleDumper(PhpcrConsoleDumperHelper $consoleDumper)
$this->consoleDumper = $consoleDumper;
}

protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -56,7 +59,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$application = $this->getApplication();
DoctrineCommandHelper::setApplicationPHPCRSession(
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeMoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class NodeMoveCommand extends BaseNodeMoveCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeRemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class NodeRemoveCommand extends BaseNodeRemoveCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeTouchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class NodeTouchCommand extends BaseNodeTouchCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeTypeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class NodeTypeListCommand extends BaseTypeListCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodeTypeRegisterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class NodeTypeRegisterCommand extends BaseRegisterNodeTypesCommand
{
private const BUNDLE_NT_PATH = 'Resources/config/phpcr-node-types';

protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();
$newHelp = <<<'EOT'
Expand All @@ -32,7 +35,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/NodesUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class NodesUpdateCommand extends BaseNodesUpdateCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/PhpcrShellCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*/
class PhpcrShellCommand extends Command
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
$this->setName('doctrine:phpcr:shell');
$this->addArgument('cmd', InputArgument::IS_ARRAY);
Expand Down Expand Up @@ -51,7 +54,10 @@ protected function configure(): void
);
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!class_exists(SessionApplication::class)) {
throw new \InvalidArgumentException(
Expand Down
10 changes: 8 additions & 2 deletions src/Command/RepositoryInitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class RepositoryInitCommand extends Command
{
use ContainerAwareTrait;

protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -34,7 +37,10 @@ protected function configure(): void
);
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (class_exists(RegisterSystemNodeTypesCommand::class)) {
DoctrineCommandHelper::setApplicationPHPCRSession(
Expand Down
10 changes: 8 additions & 2 deletions src/Command/WorkspaceCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
*/
class WorkspaceCreateCommand extends BaseWorkspaceCreateCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -22,7 +25,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/WorkspaceDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class WorkspaceDeleteCommand extends BaseWorkspaceDeleteCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/WorkspaceExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class WorkspaceExportCommand extends BaseWorkspaceExportCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/WorkspaceImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
*/
class WorkspaceImportCommand extends BaseWorkspaceImportCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -24,7 +27,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
10 changes: 8 additions & 2 deletions src/Command/WorkspaceListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
*/
class WorkspaceListCommand extends BaseWorkspaceListCommand
{
protected function configure(): void
/**
* @return void
*/
protected function configure()
{
parent::configure();

Expand All @@ -22,7 +25,10 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommandHelper::setApplicationPHPCRSession(
$this->getApplication(),
Expand Down
Loading

0 comments on commit c59d744

Please sign in to comment.