Skip to content

Commit 53135d4

Browse files
authored
Merge pull request #204 from alexander-schranz/enhancement/symfony-5-support
Add symfony 5 support
2 parents d8e0428 + 3fe5564 commit 53135d4

File tree

92 files changed

+253
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+253
-129
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
composer.lock
33
phpcr.phar
4+
.phpunit.result.cache

.travis.yml

+9-45
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,39 @@
11
language: php
2+
dist: trusty
23

34
matrix:
45
include:
5-
- php: 5.6
6+
- php: 7.2
67
env:
78
- PREFER="--prefer-lowest"
89
- BEHAT_SUITE=standalone
9-
- SYMFONY_VERSION=^2.8
10-
- php: 5.6
10+
- php: 7.2
1111
env:
1212
- PREFER="--prefer-lowest"
1313
- BEHAT_SUITE=embedded
14-
- SYMFONY_VERSION=^3.0
15-
- php: 5.6
14+
- php: 7.2
1615
env:
1716
- PREFER="--prefer-lowest"
1817
- BEHAT_SUITE=cli
19-
- SYMFONY_VERSION=^3.0
20-
- php: 7.0
21-
env:
22-
- PREFER=""
23-
- BEHAT_SUITE=standalone
24-
- SYMFONY_VERSION=^2.8
25-
- php: 7.0
26-
env:
27-
- PREFER=""
28-
- BEHAT_SUITE=embedded
29-
- SYMFONY_VERSION=^3.0
30-
- php: 7.0
31-
env:
32-
- PREFER=""
33-
- BEHAT_SUITE=cli
34-
- SYMFONY_VERSION=^3.0
35-
- php: 7.1
18+
- php: 7.4
3619
env:
3720
- PREFER=""
3821
- BEHAT_SUITE=standalone
39-
- SYMFONY_VERSION=^2.8
40-
- php: 7.1
22+
- php: 7.4
4123
env:
4224
- PREFER=""
4325
- BEHAT_SUITE=embedded
44-
- SYMFONY_VERSION=^3.4
45-
- php: 7.1
46-
env:
47-
- PREFER=""
48-
- BEHAT_SUITE=cli
49-
- SYMFONY_VERSION=^4.0
50-
- php: 7.2
51-
env:
52-
- PREFER=""
53-
- BEHAT_SUITE=standalone
54-
- SYMFONY_VERSION=^2.8
55-
- php: 7.2
56-
env:
57-
- PREFER=""
58-
- BEHAT_SUITE=embedded
59-
- SYMFONY_VERSION=^3.0
60-
- php: 7.2
26+
- php: 7.4
6127
env:
6228
- PREFER=""
6329
- BEHAT_SUITE=cli
64-
- SYMFONY_VERSION=^4.0
6530

6631
before_script:
6732
- composer self-update
68-
- composer require "symfony/symfony" "$SYMFONY_VERSION" --no-update
6933
- composer update $PREFER
7034
- bash tests/bin/travis_jackrabbit.sh
7135

72-
script:
73-
- phpunit
36+
script:
37+
- vendor/bin/phpunit
7438
- php vendor/bin/phpspec run
7539
- php vendor/behat/behat/bin/behat --suite=$BEHAT_SUITE

composer.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
"name": "phpcr/phpcr-shell",
33
"description": "Shell for PHPCR",
44
"require": {
5-
"php": "^5.6|^7.0",
6-
"symfony/console": "~2.8|~3.0|~4.0",
7-
"jackalope/jackalope": "~1.1",
8-
"phpcr/phpcr": "~2.1",
9-
"phpcr/phpcr-utils": "~1.2",
10-
"symfony/finder": "~2.8|~3.0|~4.0",
11-
"symfony/serializer": "~2.8|~3.0|~4.0",
12-
"symfony/yaml": "~2.8|~3.0|~4.0",
13-
"symfony/dependency-injection": "~2.8|~3.0|~4.0",
14-
"symfony/expression-language": "~2.8|~3.0|~4.0",
15-
"dantleech/glob-finder": "~1.0"
5+
"php": "^7.2",
6+
"symfony/console": "^5.0",
7+
"jackalope/jackalope": "^1.3.4",
8+
"phpcr/phpcr": "^2.1",
9+
"phpcr/phpcr-utils": "^1.2",
10+
"symfony/finder": "^5.0",
11+
"symfony/serializer": "^5.0",
12+
"symfony/yaml": "^5.0",
13+
"symfony/dependency-injection": "^5.0",
14+
"symfony/expression-language": "^5.0",
15+
"dantleech/glob-finder": "^1.0"
1616
},
1717
"require-dev": {
18-
"symfony/symfony": "~2.8|~3.0|~4.0",
19-
"phpunit/phpunit": "~5.7",
20-
"behat/behat": "~3.1",
21-
"phpspec/phpspec": "~3.2|~4.0",
22-
"jackalope/jackalope-doctrine-dbal": "~1.2",
23-
"jackalope/jackalope-jackrabbit": "~1.2"
18+
"phpunit/phpunit": "^8.5",
19+
"symfony/symfony": "^5.0",
20+
"behat/behat": "^3.6",
21+
"phpspec/phpspec": "^6.0",
22+
"jackalope/jackalope-doctrine-dbal": "^1.3",
23+
"jackalope/jackalope-jackrabbit": "^1.3"
2424
},
2525
"suggest": {
2626
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",

src/PHPCR/Shell/Console/Application/ShellApplication.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace PHPCR\Shell\Console\Application;
1414

15-
use PHPCR\Shell\Config\Profile;
1615
use PHPCR\Shell\Console\Command\Phpcr as CommandPhpcr;
1716
use PHPCR\Shell\Console\Command\Phpcr\BasePhpcrCommand;
1817
use PHPCR\Shell\Console\Command\Shell as CommandShell;
@@ -57,6 +56,11 @@ class ShellApplication extends Application
5756
*/
5857
protected $initialized = false;
5958

59+
/**
60+
* @var EventDispatcher
61+
*/
62+
private $dispatcher;
63+
6064
/**
6165
* Constructor - name and version inherited from SessionApplication.
6266
*
@@ -95,7 +99,7 @@ public function init()
9599
$this->registerShellCommands();
96100

97101
$event = new ApplicationInitEvent($this);
98-
$this->dispatcher->dispatch(PhpcrShellEvents::APPLICATION_INIT, $event);
102+
$this->dispatcher->dispatch($event, PhpcrShellEvents::APPLICATION_INIT);
99103
$this->initialized = true;
100104
}
101105

@@ -242,7 +246,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
242246
$name = $this->getCommandName($input);
243247

244248
$event = new Event\CommandPreRunEvent($name, $input);
245-
$this->dispatcher->dispatch(PhpcrShellEvents::COMMAND_PRE_RUN, $event);
249+
$this->dispatcher->dispatch($event, PhpcrShellEvents::COMMAND_PRE_RUN);
246250
$input = $event->getInput();
247251

248252
if (!$name) {
@@ -252,7 +256,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
252256
try {
253257
$exitCode = parent::doRun($input, $output);
254258
} catch (\Exception $e) {
255-
$this->dispatcher->dispatch(PhpcrShellEvents::COMMAND_EXCEPTION, new Event\CommandExceptionEvent($e, $this, $output));
259+
$this->dispatcher->dispatch(new Event\CommandExceptionEvent($e, $this, $output), PhpcrShellEvents::COMMAND_EXCEPTION);
256260

257261
return 1;
258262
}
@@ -292,7 +296,7 @@ public function add(Command $command)
292296
public function dispatchProfileInitEvent(InputInterface $sessionInput, OutputInterface $output)
293297
{
294298
$event = new Event\ProfileInitEvent($this->container->get('config.profile'), $sessionInput, $output);
295-
$this->dispatcher->dispatch(PhpcrShellEvents::PROFILE_INIT, $event);
299+
$this->dispatcher->dispatch($event, PhpcrShellEvents::PROFILE_INIT);
296300
}
297301

298302
/**

src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7373
foreach ($privileges as $privilege) {
7474
$table->addRow([$privilege->getName()]);
7575
}
76+
77+
return 0;
7678
}
7779
}

src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ public function execute(InputInterface $input, OutputInterface $output)
6464
}
6565

6666
$table->render($output);
67+
68+
return 0;
6769
}
6870
}

src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7979
$ownerInfo = $input->getOption('owner-info');
8080

8181
$lockManager->lock($path, $isDeep, $isSessionScoped, $timeout, $ownerInfo);
82+
83+
return 0;
8284
}
8385
}

src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace PHPCR\Shell\Console\Command\Phpcr;
1414

1515
use PHPCR\RepositoryInterface;
16-
use Symfony\Component\Console\Command\Command;
1716
use Symfony\Component\Console\Input\InputArgument;
1817
use Symfony\Component\Console\Input\InputInterface;
1918
use Symfony\Component\Console\Output\OutputInterface;
@@ -50,5 +49,7 @@ public function execute(InputInterface $input, OutputInterface $output)
5049
$lock = $lockManager->getLock($node->getPath());
5150
$lock->refresh();
5251
}
52+
53+
return 0;
5354
}
5455
}

src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4343
$lockToken = $input->getArgument('lockToken');
4444

4545
$lockManager->addLockToken($lockToken);
46+
47+
return 0;
4648
}
4749
}

src/PHPCR/Shell/Console/Command/Phpcr/LockTokenListCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,7 @@ public function execute(InputInterface $input, OutputInterface $output)
5151
}
5252

5353
$table->render($output);
54+
55+
return 0;
5456
}
5557
}

src/PHPCR/Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4040
$lockToken = $input->getArgument('lockToken');
4141

4242
$lockManager->removeLockToken($lockToken);
43+
44+
return 0;
4345
}
4446
}

src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4848
$path = $session->getAbsPath($input->getArgument('path'));
4949

5050
$lockManager->unlock($path);
51+
52+
return 0;
5153
}
5254
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7373

7474
$workspace = $session->getWorkspace();
7575
$workspace->cloneFrom($srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting);
76+
77+
return 0;
7678
}
7779
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4747

4848
$workspace = $session->getWorkspace();
4949
$workspace->copy($srcAbsPath, $destAbsPath, $srcWorkspace);
50+
51+
return 0;
5052
}
5153
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3939
$currentNode = $session->getNodeByPathOrIdentifier($path);
4040
$correspondingPath = $currentNode->getCorrespondingNodePath($workspaceName);
4141
$output->writeln($correspondingPath);
42+
43+
return 0;
4244
}
4345
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output)
5656
$nodeName = $pathHelper->getNodeName($path);
5757
$parentNode = $session->getNode($parentPath);
5858
$parentNode->addNode($nodeName, $primaryNodeTypeName);
59+
60+
return 0;
5961
}
6062
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeFileImportCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public function execute(InputInterface $input, OutputInterface $output)
105105
} else {
106106
$this->importToContainer($fhandle, $mimeType, $filePath, $filename, $parentNode, $force);
107107
}
108+
109+
return 0;
108110
}
109111

110112
private function importToProperty($fhandle, $filePath, $filename, $parentNode, $force)

src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,7 @@ public function execute(InputInterface $input, OutputInterface $output)
8585

8686
$table->render($output);
8787
}
88+
89+
return 0;
8890
}
8991
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace PHPCR\Shell\Console\Command\Phpcr;
1414

1515
use PHPCR\RepositoryInterface;
16-
use Symfony\Component\Console\Command\Command;
1716
use Symfony\Component\Console\Input\InputArgument;
1817
use Symfony\Component\Console\Input\InputInterface;
1918
use Symfony\Component\Console\Output\OutputInterface;
@@ -49,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4948
$currentNode = $session->getNodeByPathOrIdentifier($path);
5049
$transition = $input->getArgument('transition');
5150
$currentNode->followLifecycleTransition($transition);
51+
52+
return 0;
5253
}
5354
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4242
foreach ($transitions as $transition) {
4343
$output->writeln('<info>'.$transition.'</info>');
4444
}
45+
46+
return 0;
4547
}
4648
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use PHPCR\PropertyInterface;
1818
use PHPCR\PropertyType;
1919
use PHPCR\Shell\Console\Helper\Table;
20-
use Symfony\Component\Console\Command\Command;
2120
use Symfony\Component\Console\Input\InputArgument;
2221
use Symfony\Component\Console\Input\InputInterface;
2322
use Symfony\Component\Console\Input\InputOption;
@@ -141,6 +140,8 @@ public function execute(InputInterface $input, OutputInterface $output)
141140
number_format($this->time, $config['execution_time_expansion']))
142141
);
143142
}
143+
144+
return 0;
144145
}
145146

146147
private function renderNode($currentNode, $table, $spacers = [], $filter = null)

src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4646
foreach ($nodes as $node) {
4747
$node->addMixin($mixinName);
4848
}
49+
50+
return 0;
4951
}
5052
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4545
foreach ($nodes as $node) {
4646
$node->removeMixin($mixinName);
4747
}
48+
49+
return 0;
4850
}
4951
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace PHPCR\Shell\Console\Command\Phpcr;
1414

15-
use Symfony\Component\Console\Command\Command;
1615
use Symfony\Component\Console\Input\InputArgument;
1716
use Symfony\Component\Console\Input\InputInterface;
1817
use Symfony\Component\Console\Output\OutputInterface;
@@ -42,5 +41,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4241
$destPath = $input->getArgument('destPath');
4342

4443
$session->move($srcPath, $destPath);
44+
45+
return 0;
4546
}
4647
}

src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4747
$destChildRelPath = $input->getArgument('destChildRelPath');
4848
$node = $session->getNodeByPathOrIdentifier($path);
4949
$node->orderBefore($srcChildRelPath, $destChildRelPath);
50+
51+
return 0;
5052
}
5153
}

src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4444
}
4545

4646
$property->remove();
47+
48+
return 0;
4749
}
4850
}

0 commit comments

Comments
 (0)