Skip to content

Allow Symfony 3.0 #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ env:
- BEHAT_SUITE=embedded
- BEHAT_SUITE=cli


php:
- 5.4

before_script:
- composer self-update
- composer require "symfony/symfony" "2.6.*" --no-update
- composer require "symfony/symfony" "~3.0" --no-update
- composer install
- bash tests/bin/travis_jackrabbit.sh

Expand Down
29 changes: 13 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
"name": "phpcr/phpcr-shell",
"description": "Shell for PHPCR",
"require": {
"symfony/console": "~2.4",
"symfony/console": "~2.4|~3.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.8

"jackalope/jackalope": "~1.1",
"phpcr/phpcr": "~2.1",
"phpcr/phpcr-utils": "~1.2",
"symfony/finder": "~2.3",
"symfony/serializer": "~2.3",
"symfony/yaml": "~2.3",
"symfony/dependency-injection": "~2.3",
"symfony/expression-language": "~2.4",
"dantleech/glob-finder": "~1.0"
"symfony/finder": "~2.3|~3.0",
"symfony/serializer": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"symfony/dependency-injection": "~2.3|~3.0",
"symfony/expression-language": "~2.4|~3.0",
"dantleech/glob-finder": "~1.0@dev"
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"require-dev": {
"symfony/symfony": "2.6",
"symfony/process": "~2.4",
"symfony/filesystem": "~2.4",
"phpunit/phpunit": "~3.7.28",
"behat/behat": "~3.0.0",
"phpspec/phpspec": "2.0",
"symfony/symfony": "~3.0",
"phpunit/phpunit": "~4.0",
"behat/behat": "~3.0",
"phpspec/phpspec": "3.0",
"jackalope/jackalope-doctrine-dbal": "~1.1",
"jackalope/jackalope-jackrabbit": "~1.1",
"jackalope/jackalope-fs": "dev-master"
"jackalope/jackalope-jackrabbit": "~1.1"
},
"suggest": {
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
Expand Down
2 changes: 1 addition & 1 deletion src/PHPCR/Shell/Console/Application/ShellApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ protected function getDefaultCommand()
*
* {@inheritDoc}
*/
public function renderException($exception, $output)
public function renderException(\Exception $exception, OutputInterface $output)
{
$output->writeln(sprintf('<exception>%s</exception>', $exception->getMessage()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use PHPCR\RepositoryInterface;
use PHPCR\Shell\Console\Helper\Table;

class AccessControlPrivilegeListCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -65,7 +66,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$privileges = $acm->getPrivileges($absPath);
}

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

foreach ($privileges as $privilege) {
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\RepositoryInterface;
use PHPCR\Shell\Console\Helper\Table;

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

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

foreach ($info as $label => $value) {
$table->addRow(array($label, $value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\RepositoryInterface;
use PHPCR\Shell\Console\Helper\Table;

class LockTokenListCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -41,7 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output)

$lockTokens = $lockManager->getLockTokens();

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

foreach ($lockTokens as $token) {
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\Shell\Console\Helper\Table;

class NodeInfoCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -75,7 +76,7 @@ public function execute(InputInterface $input, OutputInterface $output)
);

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

foreach ($info as $label => $value) {
$table->addRow(array($label, $value));
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use PHPCR\ItemNotFoundException;
use PHPCR\PropertyInterface;
use PHPCR\NodeInterface;
use PHPCR\Shell\Console\Helper\Table;

class NodeListCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -116,7 +117,7 @@ public function execute(InputInterface $input, OutputInterface $output)
}

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

if ($table->getNumberOfRows() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\Shell\Console\Helper\Table;

class NodeReferencesCommand extends BasePhpcrCommand
{
Expand All @@ -32,7 +33,7 @@ protected function configure()
If the <info>name</info> parameter is null then all referring REFERENCES are returned
regardless of name.
HERE
);
);
}

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

$table = $this->get('helper.table')->create();
$table = new Table($output);
$table->setHeaders(array(
'Path', 'Property', 'Type',
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\Shell\Console\Helper\Table;

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

$nodeTypes = $nodeTypeManager->getAllNodeTypes();

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

foreach ($nodeTypes as $nodeType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

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

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

foreach ($keys as $key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\RepositoryInterface;
use PHPCR\Shell\Console\Helper\Table;

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

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

foreach ($holds as $hold) {
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

class SessionInfoCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -45,7 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$attribute = $session->getAttribute($attributeName);
}

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

foreach ($info as $key => $value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

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

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

foreach ($prefixes as $prefix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\RepositoryInterface;
use PHPCR\Shell\Console\Helper\Table;

class VersionHistoryCommand extends BasePhpcrCommand
{
Expand All @@ -34,7 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output)
{
$session = $this->get('phpcr.session');
$nodeHelper = $this->get('helper.node');
$table = $this->get('helper.table')->create();
$table = new Table($output);

$path = $input->getArgument('path');
$workspace = $session->getWorkspace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use PHPCR\Shell\Console\Helper\Table;

class WorkspaceListCommand extends BasePhpcrCommand
{
Expand Down Expand Up @@ -44,7 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$workspace = $session->getWorkspace();
$availableWorkspaces = $workspace->getAccessibleWorkspaceNames();

$table = $this->get('helper.table')->create();
$table = new Table($output);
$table->setHeaders(array('Name'));
foreach ($availableWorkspaces as $availableWorkspace) {
if ($availableWorkspace == $workspace->getName()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

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

$prefixes = $namespaceRegistry->getPrefixes();

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

foreach ($prefixes as $prefix) {
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPCR\Shell\Console\Command\BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

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

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

foreach ($aliases as $alias => $command) {
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPCR\Shell\Console\Command\BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use PHPCR\Shell\Console\Helper\Table;

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

foreach ($config as $key => $value) {
Expand Down
7 changes: 3 additions & 4 deletions src/PHPCR/Shell/Console/Helper/ResultFormatterHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use PHPCR\NodeInterface;
use PHPCR\PropertyInterface;
use PHPCR\Shell\Config\Config;
use PHPCR\Shell\Console\Helper\Table;

/**
* Provide methods for formatting PHPCR objects
Expand All @@ -27,13 +28,11 @@
class ResultFormatterHelper extends Helper
{
protected $textHelper;
protected $tableHelper;
protected $config;

public function __construct(TextHelper $textHelper, TableHelper $tableHelper, Config $config)
public function __construct(TextHelper $textHelper, Config $config)
{
$this->textHelper = $textHelper;
$this->tableHelper = $tableHelper;
$this->config = $config;
}

Expand Down Expand Up @@ -66,7 +65,7 @@ public function getPropertyTypeName($typeInteger)
*/
public function formatQueryResult(QueryResultInterface $result, OutputInterface $output, $elapsed)
{
$table = $this->tableHelper->create();
$table = new Table($output);
$table->setHeaders(array_merge(array(
'Path',
'Index',
Expand Down
Loading