diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 9e15c89..a4226ab 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -22,10 +22,10 @@ jobs: - php-version: '7.3' - php-version: '7.4' - php-version: '8.0' - - php-version: '8.0' - dev-dependencies: true - php-version: '8.1' - php-version: '8.2' + - php-version: '8.3' + - php-version: '8.3' steps: - name: Checkout project diff --git a/CHANGELOG.md b/CHANGELOG.md index b85a588..53f113a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ Changelog ========= +2.x +--- + +2.0.0 (unreleased) +------------------ + +* Support Symfony 7 +* Test with PHP 8.3 +* Adjusted commands to have the return type declarations. + 1.x --- diff --git a/composer.json b/composer.json index 655bd18..e4e125d 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require": { "php": "^7.2 || ^8.0", "phpcr/phpcr": "~2.1.0", - "symfony/console": "^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/console": "^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "ramsey/uuid": "^3.5", diff --git a/src/PHPCR/Util/Console/Command/NodeDumpCommand.php b/src/PHPCR/Util/Console/Command/NodeDumpCommand.php index 10cdf18..dcfbd68 100644 --- a/src/PHPCR/Util/Console/Command/NodeDumpCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeDumpCommand.php @@ -23,12 +23,7 @@ */ class NodeDumpCommand extends BaseCommand { - /** - * {@inheritdoc} - * - * @throws InvalidArgumentException - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:node:dump') @@ -56,13 +51,11 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws InvalidArgumentException * @throws Exception * @throws RepositoryException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); $dumperHelper = $this->getPhpcrConsoleDumperHelper(); diff --git a/src/PHPCR/Util/Console/Command/NodeMoveCommand.php b/src/PHPCR/Util/Console/Command/NodeMoveCommand.php index d0f3fd4..2eef8c1 100644 --- a/src/PHPCR/Util/Console/Command/NodeMoveCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeMoveCommand.php @@ -17,12 +17,7 @@ */ class NodeMoveCommand extends BaseCommand { - /** - * {@inheritdoc} - * - * @throws InvalidArgumentException - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:node:move') @@ -43,11 +38,9 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/NodeRemoveCommand.php b/src/PHPCR/Util/Console/Command/NodeRemoveCommand.php index 280fb5a..0ee7431 100644 --- a/src/PHPCR/Util/Console/Command/NodeRemoveCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeRemoveCommand.php @@ -21,12 +21,7 @@ */ class NodeRemoveCommand extends BaseCommand { - /** - * {@inheritdoc} - * - * @throws CliInvalidArgumentException - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -53,12 +48,10 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws CliInvalidArgumentException * @throws InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/NodeTouchCommand.php b/src/PHPCR/Util/Console/Command/NodeTouchCommand.php index 7ca3f0e..e3cd0f4 100644 --- a/src/PHPCR/Util/Console/Command/NodeTouchCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeTouchCommand.php @@ -21,12 +21,7 @@ */ class NodeTouchCommand extends BaseNodeManipulationCommand { - /** - * {@inheritdoc} - * - * @throws InvalidArgumentException - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -73,11 +68,9 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $helper = $this->getPhpcrHelper(); $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/NodeTypeListCommand.php b/src/PHPCR/Util/Console/Command/NodeTypeListCommand.php index 2f95fa5..557e6fa 100644 --- a/src/PHPCR/Util/Console/Command/NodeTypeListCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeTypeListCommand.php @@ -15,10 +15,7 @@ */ class NodeTypeListCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:node-type:list') @@ -31,10 +28,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); $ntm = $session->getWorkspace()->getNodeTypeManager(); diff --git a/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php b/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php index 9cf78ed..0534b2c 100644 --- a/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php @@ -26,10 +26,7 @@ */ class NodeTypeRegisterCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:node-type:register') @@ -62,11 +59,9 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $definitions = $input->getArgument('cnd-file'); diff --git a/src/PHPCR/Util/Console/Command/NodesUpdateCommand.php b/src/PHPCR/Util/Console/Command/NodesUpdateCommand.php index 50aa22d..6e29b1d 100644 --- a/src/PHPCR/Util/Console/Command/NodesUpdateCommand.php +++ b/src/PHPCR/Util/Console/Command/NodesUpdateCommand.php @@ -20,12 +20,7 @@ */ class NodesUpdateCommand extends BaseNodeManipulationCommand { - /** - * {@inheritdoc} - * - * @throws CliInvalidArgumentException - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -85,12 +80,10 @@ protected function configure() } /** - * {@inheritdoc} - * * @throws CliInvalidArgumentException * @throws InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $query = $input->getOption('query'); $queryLanguage = strtoupper($input->getOption('query-language')); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php index c0ac8a6..b9c1401 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php @@ -18,10 +18,7 @@ */ class WorkspaceCreateCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:workspace:create') @@ -42,10 +39,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceDeleteCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceDeleteCommand.php index 9200fe6..fd63d40 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceDeleteCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceDeleteCommand.php @@ -17,10 +17,7 @@ */ class WorkspaceDeleteCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:workspace:delete') @@ -37,10 +34,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php index 5708e79..c8e0f7b 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php @@ -17,10 +17,7 @@ */ class WorkspaceExportCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -42,10 +39,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); $repo = $session->getRepository(); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php index 4b6578d..1641d7f 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php @@ -24,10 +24,7 @@ class WorkspaceImportCommand extends BaseCommand 'throw' => ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW, ]; - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -62,10 +59,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $filename = $input->getArgument('filename'); $parentPath = $input->getOption('parentpath'); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceListCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceListCommand.php index 3165f8b..4210891 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceListCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceListCommand.php @@ -14,10 +14,7 @@ */ class WorkspaceListCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $this ->setName('phpcr:workspace:list') @@ -29,10 +26,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); diff --git a/src/PHPCR/Util/Console/Command/WorkspacePurgeCommand.php b/src/PHPCR/Util/Console/Command/WorkspacePurgeCommand.php index c8c8f81..c33baa9 100644 --- a/src/PHPCR/Util/Console/Command/WorkspacePurgeCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspacePurgeCommand.php @@ -17,10 +17,7 @@ */ class WorkspacePurgeCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -36,10 +33,7 @@ protected function configure() ); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $session = $this->getPhpcrSession(); $force = $input->getOption('force'); diff --git a/src/PHPCR/Util/Console/Command/WorkspaceQueryCommand.php b/src/PHPCR/Util/Console/Command/WorkspaceQueryCommand.php index f4d7fc1..d7015ff 100644 --- a/src/PHPCR/Util/Console/Command/WorkspaceQueryCommand.php +++ b/src/PHPCR/Util/Console/Command/WorkspaceQueryCommand.php @@ -18,10 +18,7 @@ */ class WorkspaceQueryCommand extends BaseCommand { - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { parent::configure(); @@ -34,10 +31,7 @@ protected function configure() ->setHelp('The query command executes a JCR query statement on the content repository'); } - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $sql = $input->getArgument('query'); $language = $input->getOption('language'); diff --git a/src/PHPCR/Util/Console/Helper/PhpcrConsoleDumperHelper.php b/src/PHPCR/Util/Console/Helper/PhpcrConsoleDumperHelper.php index d7d3cdb..04c3522 100644 --- a/src/PHPCR/Util/Console/Helper/PhpcrConsoleDumperHelper.php +++ b/src/PHPCR/Util/Console/Helper/PhpcrConsoleDumperHelper.php @@ -43,10 +43,7 @@ public function getTreeWalker(OutputInterface $output, $options) return $treeWalker; } - /** - * {@inheritdoc} - */ - public function getName() + public function getName(): string { return 'phpcr_console_dumper'; } diff --git a/src/PHPCR/Util/Console/Helper/PhpcrHelper.php b/src/PHPCR/Util/Console/Helper/PhpcrHelper.php index edb6edc..8e044dd 100644 --- a/src/PHPCR/Util/Console/Helper/PhpcrHelper.php +++ b/src/PHPCR/Util/Console/Helper/PhpcrHelper.php @@ -44,10 +44,7 @@ public function getSession() return $this->session; } - /** - * {@inheritdoc} - */ - public function getName() + public function getName(): string { return 'phpcr'; }