From 208aeb359561077c18476ee8890620cd7658d403 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 24 May 2023 11:34:21 +0200 Subject: [PATCH] revert BC break with command return types --- CHANGELOG.md | 5 +++++ src/Command/LoadFixtureCommand.php | 10 ++++++++-- src/Command/MigratorMigrateCommand.php | 10 ++++++++-- src/Command/NodeDumpCommand.php | 10 ++++++++-- src/Command/NodeMoveCommand.php | 10 ++++++++-- src/Command/NodeRemoveCommand.php | 10 ++++++++-- src/Command/NodeTouchCommand.php | 10 ++++++++-- src/Command/NodeTypeListCommand.php | 10 ++++++++-- src/Command/NodeTypeRegisterCommand.php | 10 ++++++++-- src/Command/NodesUpdateCommand.php | 10 ++++++++-- src/Command/PhpcrShellCommand.php | 10 ++++++++-- src/Command/RepositoryInitCommand.php | 10 ++++++++-- src/Command/WorkspaceCreateCommand.php | 10 ++++++++-- src/Command/WorkspaceDeleteCommand.php | 10 ++++++++-- src/Command/WorkspaceExportCommand.php | 10 ++++++++-- src/Command/WorkspaceImportCommand.php | 10 ++++++++-- src/Command/WorkspaceListCommand.php | 10 ++++++++-- src/Command/WorkspacePurgeCommand.php | 10 ++++++++-- src/Command/WorkspaceQueryCommand.php | 10 ++++++++-- .../Jackalope/InitDoctrineDbalCommand.php | 10 ++++++++-- src/OptionalCommand/Jackalope/JackrabbitCommand.php | 10 ++++++++-- .../ODM/DocumentConvertTranslationCommand.php | 10 ++++++++-- .../ODM/DocumentMigrateClassCommand.php | 10 ++++++++-- src/OptionalCommand/ODM/InfoDoctrineCommand.php | 10 ++++++++-- .../ODM/VerifyUniqueNodeTypesMappingCommand.php | 10 ++++++++-- 25 files changed, 197 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3c2d419..a8c565a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ----- diff --git a/src/Command/LoadFixtureCommand.php b/src/Command/LoadFixtureCommand.php index 897eeeb9..702b11c0 100644 --- a/src/Command/LoadFixtureCommand.php +++ b/src/Command/LoadFixtureCommand.php @@ -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') @@ -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( diff --git a/src/Command/MigratorMigrateCommand.php b/src/Command/MigratorMigrateCommand.php index f7402d7a..2c19fdc7 100644 --- a/src/Command/MigratorMigrateCommand.php +++ b/src/Command/MigratorMigrateCommand.php @@ -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') @@ -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(), diff --git a/src/Command/NodeDumpCommand.php b/src/Command/NodeDumpCommand.php index bf77c56e..cfb84c45 100644 --- a/src/Command/NodeDumpCommand.php +++ b/src/Command/NodeDumpCommand.php @@ -46,7 +46,10 @@ public function setConsoleDumper(PhpcrConsoleDumperHelper $consoleDumper) $this->consoleDumper = $consoleDumper; } - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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( diff --git a/src/Command/NodeMoveCommand.php b/src/Command/NodeMoveCommand.php index 975c77b4..0d3ee3fe 100644 --- a/src/Command/NodeMoveCommand.php +++ b/src/Command/NodeMoveCommand.php @@ -14,7 +14,10 @@ */ class NodeMoveCommand extends BaseNodeMoveCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/NodeRemoveCommand.php b/src/Command/NodeRemoveCommand.php index 67fc6d2f..29bdd5b8 100644 --- a/src/Command/NodeRemoveCommand.php +++ b/src/Command/NodeRemoveCommand.php @@ -14,7 +14,10 @@ */ class NodeRemoveCommand extends BaseNodeRemoveCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/NodeTouchCommand.php b/src/Command/NodeTouchCommand.php index 55228642..ed52d3fc 100644 --- a/src/Command/NodeTouchCommand.php +++ b/src/Command/NodeTouchCommand.php @@ -14,7 +14,10 @@ */ class NodeTouchCommand extends BaseNodeTouchCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/NodeTypeListCommand.php b/src/Command/NodeTypeListCommand.php index 567c704a..b264f1d0 100644 --- a/src/Command/NodeTypeListCommand.php +++ b/src/Command/NodeTypeListCommand.php @@ -14,7 +14,10 @@ */ class NodeTypeListCommand extends BaseTypeListCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/NodeTypeRegisterCommand.php b/src/Command/NodeTypeRegisterCommand.php index ee92080c..59deebc2 100644 --- a/src/Command/NodeTypeRegisterCommand.php +++ b/src/Command/NodeTypeRegisterCommand.php @@ -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' @@ -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(), diff --git a/src/Command/NodesUpdateCommand.php b/src/Command/NodesUpdateCommand.php index 434f33ad..fe13fdf8 100644 --- a/src/Command/NodesUpdateCommand.php +++ b/src/Command/NodesUpdateCommand.php @@ -14,7 +14,10 @@ */ class NodesUpdateCommand extends BaseNodesUpdateCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/PhpcrShellCommand.php b/src/Command/PhpcrShellCommand.php index 7263fc06..23d72249 100644 --- a/src/Command/PhpcrShellCommand.php +++ b/src/Command/PhpcrShellCommand.php @@ -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); @@ -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( diff --git a/src/Command/RepositoryInitCommand.php b/src/Command/RepositoryInitCommand.php index cc1d6a85..2d8a4785 100644 --- a/src/Command/RepositoryInitCommand.php +++ b/src/Command/RepositoryInitCommand.php @@ -18,7 +18,10 @@ class RepositoryInitCommand extends Command { use ContainerAwareTrait; - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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( diff --git a/src/Command/WorkspaceCreateCommand.php b/src/Command/WorkspaceCreateCommand.php index a1457c23..eb21070f 100644 --- a/src/Command/WorkspaceCreateCommand.php +++ b/src/Command/WorkspaceCreateCommand.php @@ -12,7 +12,10 @@ */ class WorkspaceCreateCommand extends BaseWorkspaceCreateCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspaceDeleteCommand.php b/src/Command/WorkspaceDeleteCommand.php index 77db4b8b..d5e2977a 100644 --- a/src/Command/WorkspaceDeleteCommand.php +++ b/src/Command/WorkspaceDeleteCommand.php @@ -14,7 +14,10 @@ */ class WorkspaceDeleteCommand extends BaseWorkspaceDeleteCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspaceExportCommand.php b/src/Command/WorkspaceExportCommand.php index c3098bb4..7232d800 100644 --- a/src/Command/WorkspaceExportCommand.php +++ b/src/Command/WorkspaceExportCommand.php @@ -14,7 +14,10 @@ */ class WorkspaceExportCommand extends BaseWorkspaceExportCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspaceImportCommand.php b/src/Command/WorkspaceImportCommand.php index cd222e1b..1c38e0e4 100644 --- a/src/Command/WorkspaceImportCommand.php +++ b/src/Command/WorkspaceImportCommand.php @@ -14,7 +14,10 @@ */ class WorkspaceImportCommand extends BaseWorkspaceImportCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspaceListCommand.php b/src/Command/WorkspaceListCommand.php index ff5b2f0c..b5c01191 100644 --- a/src/Command/WorkspaceListCommand.php +++ b/src/Command/WorkspaceListCommand.php @@ -12,7 +12,10 @@ */ class WorkspaceListCommand extends BaseWorkspaceListCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspacePurgeCommand.php b/src/Command/WorkspacePurgeCommand.php index 0349b7aa..ea66b925 100644 --- a/src/Command/WorkspacePurgeCommand.php +++ b/src/Command/WorkspacePurgeCommand.php @@ -14,7 +14,10 @@ */ class WorkspacePurgeCommand extends BaseWorkspacePurgeCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/Command/WorkspaceQueryCommand.php b/src/Command/WorkspaceQueryCommand.php index 8b36973a..3f37b47a 100644 --- a/src/Command/WorkspaceQueryCommand.php +++ b/src/Command/WorkspaceQueryCommand.php @@ -14,7 +14,10 @@ */ class WorkspaceQueryCommand extends BaseWorkspaceQueryCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -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(), diff --git a/src/OptionalCommand/Jackalope/InitDoctrineDbalCommand.php b/src/OptionalCommand/Jackalope/InitDoctrineDbalCommand.php index e53c4930..35ef6b08 100644 --- a/src/OptionalCommand/Jackalope/InitDoctrineDbalCommand.php +++ b/src/OptionalCommand/Jackalope/InitDoctrineDbalCommand.php @@ -13,7 +13,10 @@ */ class InitDoctrineDbalCommand extends BaseInitDoctrineDbalCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -23,7 +26,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(); $sessionName = $input->getOption('session'); diff --git a/src/OptionalCommand/Jackalope/JackrabbitCommand.php b/src/OptionalCommand/Jackalope/JackrabbitCommand.php index 2c8292ab..f15a1b9b 100644 --- a/src/OptionalCommand/Jackalope/JackrabbitCommand.php +++ b/src/OptionalCommand/Jackalope/JackrabbitCommand.php @@ -37,7 +37,10 @@ public function setContainer(ContainerInterface $container = null) $this->container = $container; } - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -55,7 +58,10 @@ protected function configure(): void ; } - protected function execute(InputInterface $input, OutputInterface $output): int + /** + * @return int + */ + protected function execute(InputInterface $input, OutputInterface $output) { if ($this->getContainer()->hasParameter('doctrine_phpcr.jackrabbit_jar')) { $this->setJackrabbitPath($this->getContainer()->getParameter('doctrine_phpcr.jackrabbit_jar')); diff --git a/src/OptionalCommand/ODM/DocumentConvertTranslationCommand.php b/src/OptionalCommand/ODM/DocumentConvertTranslationCommand.php index 66e07da5..21b72974 100644 --- a/src/OptionalCommand/ODM/DocumentConvertTranslationCommand.php +++ b/src/OptionalCommand/ODM/DocumentConvertTranslationCommand.php @@ -15,7 +15,10 @@ */ class DocumentConvertTranslationCommand extends BaseDocumentConvertTranslationCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -31,7 +34,10 @@ protected function configure(): void ); } - protected function execute(InputInterface $input, OutputInterface $output): int + /** + * @return int + */ + protected function execute(InputInterface $input, OutputInterface $output) { DoctrineCommandHelper::setApplicationDocumentManager( $this->getApplication(), diff --git a/src/OptionalCommand/ODM/DocumentMigrateClassCommand.php b/src/OptionalCommand/ODM/DocumentMigrateClassCommand.php index da1a9a5e..2202c753 100644 --- a/src/OptionalCommand/ODM/DocumentMigrateClassCommand.php +++ b/src/OptionalCommand/ODM/DocumentMigrateClassCommand.php @@ -13,14 +13,20 @@ */ class DocumentMigrateClassCommand extends BaseDocumentMigrateClassCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); $this->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command'); } - 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( diff --git a/src/OptionalCommand/ODM/InfoDoctrineCommand.php b/src/OptionalCommand/ODM/InfoDoctrineCommand.php index 5cef0f56..0190fbe9 100644 --- a/src/OptionalCommand/ODM/InfoDoctrineCommand.php +++ b/src/OptionalCommand/ODM/InfoDoctrineCommand.php @@ -15,7 +15,10 @@ */ class InfoDoctrineCommand extends BaseInfoDoctrineCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -31,7 +34,10 @@ protected function configure(): void ); } - protected function execute(InputInterface $input, OutputInterface $output): int + /** + * @return int + */ + protected function execute(InputInterface $input, OutputInterface $output) { DoctrineCommandHelper::setApplicationDocumentManager( $this->getApplication(), diff --git a/src/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php b/src/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php index aa5ce677..53c2aae6 100644 --- a/src/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php +++ b/src/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php @@ -13,7 +13,10 @@ */ class VerifyUniqueNodeTypesMappingCommand extends BaseVerifyUniqueNodeTypesMappingCommand { - protected function configure(): void + /** + * @return void + */ + protected function configure() { parent::configure(); @@ -28,7 +31,10 @@ protected function configure(): void ); } - protected function execute(InputInterface $input, OutputInterface $output): int + /** + * @return int + */ + protected function execute(InputInterface $input, OutputInterface $output) { DoctrineCommandHelper::setApplicationDocumentManager( $this->getApplication(),