Skip to content

Commit 7e45f81

Browse files
authored
Merge pull request #180 from phpcr/allow_3_0
Allow Symfony 3.0
2 parents 491d657 + 85a22a4 commit 7e45f81

29 files changed

+100
-163
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ env:
55
- BEHAT_SUITE=embedded
66
- BEHAT_SUITE=cli
77

8-
98
php:
10-
- 5.4
9+
- 5.6
1110

1211
before_script:
1312
- composer self-update
14-
- composer require "symfony/symfony" "2.6.*" --no-update
13+
- composer require "symfony/symfony" "~2.8" --no-update
1514
- composer install
1615
- bash tests/bin/travis_jackrabbit.sh
1716

composer.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,25 @@
22
"name": "phpcr/phpcr-shell",
33
"description": "Shell for PHPCR",
44
"require": {
5-
"symfony/console": "~2.4",
5+
"symfony/console": "~2.8|~3.0",
66
"jackalope/jackalope": "~1.1",
77
"phpcr/phpcr": "~2.1",
88
"phpcr/phpcr-utils": "~1.2",
9-
"symfony/finder": "~2.3",
10-
"symfony/serializer": "~2.3",
11-
"symfony/yaml": "~2.3",
12-
"symfony/dependency-injection": "~2.3",
13-
"symfony/expression-language": "~2.4",
9+
"symfony/finder": "~2.8|~3.0",
10+
"symfony/serializer": "~2.8|~3.0",
11+
"symfony/yaml": "~2.8|~3.0",
12+
"symfony/dependency-injection": "~2.8|~3.0",
13+
"symfony/expression-language": "~2.8|~3.0",
1414
"dantleech/glob-finder": "~1.0"
1515
},
16-
"minimum-stability": "dev",
16+
"minimum-stability": "stable",
1717
"require-dev": {
18-
"symfony/symfony": "2.6",
19-
"symfony/process": "~2.4",
20-
"symfony/filesystem": "~2.4",
21-
"phpunit/phpunit": "~3.7.28",
22-
"behat/behat": "~3.0.0",
23-
"phpspec/phpspec": "2.0",
18+
"symfony/symfony": "~2.8|~3.0",
19+
"phpunit/phpunit": "~4.0",
20+
"behat/behat": "~3.0",
21+
"phpspec/phpspec": "3.0",
2422
"jackalope/jackalope-doctrine-dbal": "~1.1",
25-
"jackalope/jackalope-jackrabbit": "~1.1",
26-
"jackalope/jackalope-fs": "dev-master"
23+
"jackalope/jackalope-jackrabbit": "~1.1"
2724
},
2825
"suggest": {
2926
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",

spec/PHPCR/Shell/Console/Helper/ResultFormatterHelperSpec.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ class ResultFormatterHelperSpec extends ObjectBehavior
2020
{
2121
public function let(
2222
TextHelper $textHelper,
23-
TableHelper $tableHelper,
2423
Config $config
2524
)
2625
{
27-
$this->beConstructedWith($textHelper, $tableHelper, $config);
26+
$this->beConstructedWith($textHelper, $config);
2827
}
2928

3029
public function it_is_initializable()

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,6 @@ protected function getDefaultCommand()
267267
return 'shell:path:show';
268268
}
269269

270-
/**
271-
* Render an exception to the console
272-
*
273-
* {@inheritDoc}
274-
*/
275-
public function renderException($exception, $output)
276-
{
277-
$output->writeln(sprintf('<exception>%s</exception>', $exception->getMessage()));
278-
}
279-
280270
/**
281271
* Wrap the add method and do not register commands which are unsupported by
282272
* the current transport.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Console\Input\InputArgument;
1717
use Symfony\Component\Console\Input\InputOption;
1818
use PHPCR\RepositoryInterface;
19+
use PHPCR\Shell\Console\Helper\Table;
1920

2021
class AccessControlPrivilegeListCommand extends BasePhpcrCommand
2122
{
@@ -65,7 +66,7 @@ public function execute(InputInterface $input, OutputInterface $output)
6566
$privileges = $acm->getPrivileges($absPath);
6667
}
6768

68-
$table = $this->get('helper.table')->create();
69+
$table = new Table($output);
6970
$table->setHeaders(array('Name'));
7071

7172
foreach ($privileges as $privilege) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
1717
use PHPCR\RepositoryInterface;
18+
use PHPCR\Shell\Console\Helper\Table;
1819

1920
class LockInfoCommand extends BasePhpcrCommand
2021
{
@@ -55,7 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output)
5556
'Session scoped?' => $lock->isSessionScoped() ? 'yes' : 'no',
5657
);
5758

58-
$table = $this->get('helper.table')->create();
59+
$table = new Table($output);
5960

6061
foreach ($info as $label => $value) {
6162
$table->addRow(array($label, $value));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use PHPCR\RepositoryInterface;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class LockTokenListCommand extends BasePhpcrCommand
1920
{
@@ -41,7 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4142

4243
$lockTokens = $lockManager->getLockTokens();
4344

44-
$table = $this->get('helper.table')->create();
45+
$table = new Table($output);
4546
$table->setHeaders(array('Token'));
4647

4748
foreach ($lockTokens as $token) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class NodeInfoCommand extends BasePhpcrCommand
1920
{
@@ -75,7 +76,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7576
);
7677

7778
$output->writeln('<path>' . $node->getPath() . '</path>');
78-
$table = $this->get('helper.table')->create();
79+
$table = new Table($output);
7980

8081
foreach ($info as $label => $value) {
8182
$table->addRow(array($label, $value));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use PHPCR\ItemNotFoundException;
2121
use PHPCR\PropertyInterface;
2222
use PHPCR\NodeInterface;
23+
use PHPCR\Shell\Console\Helper\Table;
2324

2425
class NodeListCommand extends BasePhpcrCommand
2526
{
@@ -116,7 +117,7 @@ public function execute(InputInterface $input, OutputInterface $output)
116117
}
117118

118119
foreach ($nodes as $node) {
119-
$table = $this->get('helper.table')->create();
120+
$table = new Table($output);
120121
$this->renderNode($node, $table, array(), $filter);
121122

122123
if ($table->getNumberOfRows() > 0) {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
1717
use Symfony\Component\Console\Input\InputArgument;
18+
use PHPCR\Shell\Console\Helper\Table;
1819

1920
class NodeReferencesCommand extends BasePhpcrCommand
2021
{
@@ -32,7 +33,7 @@ protected function configure()
3233
If the <info>name</info> parameter is null then all referring REFERENCES are returned
3334
regardless of name.
3435
HERE
35-
);
36+
);
3637
}
3738

3839
public function execute(InputInterface $input, OutputInterface $output)
@@ -52,7 +53,7 @@ public function execute(InputInterface $input, OutputInterface $output)
5253
$references['weak'] = $node->getWeakReferences($name ?: null);
5354
$references['strong'] = $node->getReferences($name ?: null);
5455

55-
$table = $this->get('helper.table')->create();
56+
$table = new Table($output);
5657
$table->setHeaders(array(
5758
'Path', 'Property', 'Type',
5859
));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class NodeTypeListCommand extends BasePhpcrCommand
1920
{
@@ -40,7 +41,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4041

4142
$nodeTypes = $nodeTypeManager->getAllNodeTypes();
4243

43-
$table = $this->get('helper.table')->create();
44+
$table = new Table($output);
4445
$table->setHeaders(array('Name', 'Primary Item Name', 'Abstract?', 'Mixin?', 'Queryable?'));
4546

4647
foreach ($nodeTypes as $nodeType) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Command\Command;
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class RepositoryDescriptorListCommand extends BasePhpcrCommand
1920
{
@@ -34,7 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3435
$repository = $session->getRepository();
3536
$keys = $repository->getDescriptorKeys();
3637

37-
$table = $this->get('helper.table')->create();
38+
$table = new Table($output);
3839
$table->setHeaders(array('Key', 'Value', 'Standard?'));
3940

4041
foreach ($keys as $key) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
1717
use PHPCR\RepositoryInterface;
18+
use PHPCR\Shell\Console\Helper\Table;
1819

1920
class RetentionHoldListCommand extends BasePhpcrCommand
2021
{
@@ -39,7 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3940
$absPath = $input->getArgument('absPath');
4041

4142
$holds = $retentionManager->getHolds($absPath);
42-
$table = $this->get('helper.table')->create();
43+
$table = new Table($output);
4344
$table->setHeaders(array('Name'));
4445

4546
foreach ($holds as $hold) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Command\Command;
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class SessionInfoCommand extends BasePhpcrCommand
1920
{
@@ -45,7 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4546
$attribute = $session->getAttribute($attributeName);
4647
}
4748

48-
$table = $this->get('helper.table')->create();
49+
$table = new Table($output);
4950
$table->setHeaders(array('Key', 'Value'));
5051

5152
foreach ($info as $key => $value) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
16+
use PHPCR\Shell\Console\Helper\Table;
1617

1718
class SessionNamespaceListCommand extends BasePhpcrCommand
1819
{
@@ -31,7 +32,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3132
$session = $this->get('phpcr.session');
3233
$prefixes = $session->getNamespacePrefixes();
3334

34-
$table = $this->get('helper.table')->create();
35+
$table = new Table($output);
3536
$table->setHeaders(array('Prefix', 'URI'));
3637

3738
foreach ($prefixes as $prefix) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
1717
use PHPCR\RepositoryInterface;
18+
use PHPCR\Shell\Console\Helper\Table;
1819

1920
class VersionHistoryCommand extends BasePhpcrCommand
2021
{
@@ -34,7 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3435
{
3536
$session = $this->get('phpcr.session');
3637
$nodeHelper = $this->get('helper.node');
37-
$table = $this->get('helper.table')->create();
38+
$table = new Table($output);
3839

3940
$path = $input->getArgument('path');
4041
$workspace = $session->getWorkspace();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class WorkspaceListCommand extends BasePhpcrCommand
1920
{
@@ -44,7 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4445
$workspace = $session->getWorkspace();
4546
$availableWorkspaces = $workspace->getAccessibleWorkspaceNames();
4647

47-
$table = $this->get('helper.table')->create();
48+
$table = new Table($output);
4849
$table->setHeaders(array('Name'));
4950
foreach ($availableWorkspaces as $availableWorkspace) {
5051
if ($availableWorkspace == $workspace->getName()) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
16+
use PHPCR\Shell\Console\Helper\Table;
1617

1718
class WorkspaceNamespaceListCommand extends BasePhpcrCommand
1819
{
@@ -34,7 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3435

3536
$prefixes = $namespaceRegistry->getPrefixes();
3637

37-
$table = $this->get('helper.table')->create();
38+
$table = new Table($output);
3839
$table->setHeaders(array('Prefix', 'URI'));
3940

4041
foreach ($prefixes as $prefix) {

src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPCR\Shell\Console\Command\BaseCommand;
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class AliasListCommand extends BaseCommand
1920
{
@@ -32,7 +33,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3233
$config = $this->get('config.manager');
3334
$aliases = $config->getConfig('alias');
3435

35-
$table = $this->get('helper.table')->create();
36+
$table = new Table($output);
3637
$table->setHeaders(array('Alias', 'Command'));
3738

3839
foreach ($aliases as $alias => $command) {

src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPCR\Shell\Console\Command\BaseCommand;
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
17+
use PHPCR\Shell\Console\Helper\Table;
1718

1819
class ProfileShowCommand extends BaseCommand
1920
{
@@ -38,7 +39,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3839
$output->writeln('');
3940
foreach ($profile->toArray() as $domain => $config) {
4041
$output->writeln('<comment>' . $domain . '</comment>');
41-
$table = $this->get('helper.table')->create();
42+
$table = new Table($output);
4243
$table->setHeaders(array('Key', 'Value'));
4344

4445
foreach ($config as $key => $value) {

src/PHPCR/Shell/Console/Helper/ResultFormatterHelper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use PHPCR\NodeInterface;
1919
use PHPCR\PropertyInterface;
2020
use PHPCR\Shell\Config\Config;
21+
use PHPCR\Shell\Console\Helper\Table;
2122

2223
/**
2324
* Provide methods for formatting PHPCR objects
@@ -27,13 +28,11 @@
2728
class ResultFormatterHelper extends Helper
2829
{
2930
protected $textHelper;
30-
protected $tableHelper;
3131
protected $config;
3232

33-
public function __construct(TextHelper $textHelper, TableHelper $tableHelper, Config $config)
33+
public function __construct(TextHelper $textHelper, Config $config)
3434
{
3535
$this->textHelper = $textHelper;
36-
$this->tableHelper = $tableHelper;
3736
$this->config = $config;
3837
}
3938

@@ -66,7 +65,7 @@ public function getPropertyTypeName($typeInteger)
6665
*/
6766
public function formatQueryResult(QueryResultInterface $result, OutputInterface $output, $elapsed)
6867
{
69-
$table = $this->tableHelper->create();
68+
$table = new Table($output);
7069
$table->setHeaders(array_merge(array(
7170
'Path',
7271
'Index',

0 commit comments

Comments
 (0)