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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 9 additions & 45 deletions
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

Lines changed: 17 additions & 17 deletions
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

Lines changed: 9 additions & 5 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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
}

0 commit comments

Comments
 (0)