Skip to content

Apply fixes from StyleCI #195

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 1 commit into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions spec/PHPCR/Shell/Query/UpdateParserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function it_should_parse_functions(
$qomf->selector('a', 'dtl:article')->willReturn($source);
$qomf->createQuery($source, null)->willReturn($query);


$sql = <<<'EOT'
UPDATE [dtl:article] AS a SET a.tags = array_replace(a.tags, 'asd', 'dsa')
EOT;
Expand All @@ -110,7 +109,6 @@ public function it_should_parse_apply(
$qomf->selector('a', 'dtl:article')->willReturn($source);
$qomf->createQuery($source, null)->willReturn($query);


$sql = <<<'EOT'
UPDATE [dtl:article] AS a APPLY nodetype_add('nt:barbar')
EOT;
Expand Down
2 changes: 2 additions & 0 deletions src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ private function renderChildren($currentNode, $table, $spacers, $filter = null)
}

$primaryItemValue = '';

try {
$primaryItem = $child->getPrimaryItem();

Expand Down Expand Up @@ -243,6 +244,7 @@ private function renderProperties($currentNode, $table, $spacers, $filter = null
$i = 0;
foreach ($properties as $name => $property) {
$this->nbProperties++;

try {
$i++;
if (isset($propertyNames[$name])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function execute(InputInterface $input, OutputInterface $output)
// convert path to UUID
if (false === UUIDHelper::isUuid($value)) {
$path = $value;

try {
$targetNode = $session->getNode($path);
$value = $targetNode->getIdentifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function execute(InputInterface $input, OutputInterface $output)
$updates = $res->offsetGet(1);
$applies = $res->offsetGet(3);


$start = microtime(true);
$result = $query->execute();
$rows = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function execute(InputInterface $input, OutputInterface $output)
{
$session = $this->get('phpcr.session');
$path = $input->getArgument('path');

try {
$session->chdir($path);
$output->writeln('<comment>'.$session->getCwd().'</comment>');
Expand Down
1 change: 1 addition & 0 deletions src/PHPCR/Shell/Phpcr/PhpcrSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function autocomplete($text)
{
// return autocompletions for current path
$cwd = $this->getCwd();

try {
$node = $this->getNode($cwd);
$list = (array) $node->getNodeNames();
Expand Down
1 change: 0 additions & 1 deletion src/PHPCR/Shell/Query/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
*/


namespace \PHPCR\Shell\Query;

class Validator
Expand Down
1 change: 0 additions & 1 deletion src/PHPCR/Shell/Subscriber/ProfileLoaderSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use PHPCR\Shell\Config\ProfileLoader;
use PHPCR\Shell\Event\PhpcrShellEvents;
use PHPCR\Shell\Event\ProfileInitEvent;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down
1 change: 0 additions & 1 deletion src/PHPCR/Shell/Subscriber/ProfileWriterSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use PHPCR\Shell\Config\ProfileLoader;
use PHPCR\Shell\Event\PhpcrShellEvents;
use PHPCR\Shell\Event\ProfileInitEvent;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand Down
6 changes: 6 additions & 0 deletions src/PHPCR/Shell/Test/ContextBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ public function thereShouldNotExistANamespacePrefix($arg1)
public function thereShouldExistANodeAt($arg1)
{
$session = $this->getSession();

try {
$session->getNode($arg1);
} catch (PathNotFoundException $e) {
Expand Down Expand Up @@ -472,6 +473,7 @@ public function thereShouldNotExistANodeAt($arg1)

try {
$session->getNode($arg1);

throw new \Exception('Node at path '.$arg1.' exists.');
} catch (PathNotFoundException $e) {
// good.. not does not exist
Expand Down Expand Up @@ -505,6 +507,7 @@ public function thereShouldNotExistAPropertyAt($arg1)

try {
$session->getProperty($arg1);

throw new \Exception('Property exists at "'.$arg1.'"');
} catch (PathNotFoundException $e) {
// good
Expand Down Expand Up @@ -577,6 +580,7 @@ public function thereExistsAWorkspace($arg1)
{
$session = $this->getSession();
$workspace = $session->getWorkspace();

try {
$workspace->createWorkspace($arg1);
} catch (\Exception $e) {
Expand All @@ -591,6 +595,7 @@ public function thereShouldNotExistAWorkspaceCalled($arg1)
{
try {
$this->thereShouldExistAWorkspaceCalled($arg1);

throw new \Exception(sprintf('Workspace "%s" exists.', $arg1));
} catch (\Exception $e) {
}
Expand Down Expand Up @@ -642,6 +647,7 @@ public function thereShouldNotExistANodeTypeNamed($arg1)
$session = $this->getSession();
$workspace = $session->getWorkspace();
$nodeTypeManager = $workspace->getNodeTypeManager();

try {
$nodeTypeManager->getNodeType($arg1);
} catch (\Exception $e) {
Expand Down