Skip to content

Commit 6591f92

Browse files
dbuStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent a239bde commit 6591f92

23 files changed

+126
-62
lines changed

src/PHPCR/Util/CND/Parser/CndParser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ protected function parsePropDef(NodeTypeTemplateInterface $nodeType)
369369
protected function parsePropertyType(PropertyDefinitionTemplateInterface $property)
370370
{
371371
$types = ['STRING', 'BINARY', 'LONG', 'DOUBLE', 'BOOLEAN', 'DATE', 'NAME', 'PATH',
372-
'REFERENCE', 'WEAKREFERENCE', 'DECIMAL', 'URI', 'UNDEFINED', '*', '?', ];
372+
'REFERENCE', 'WEAKREFERENCE', 'DECIMAL', 'URI', 'UNDEFINED', '*', '?', ];
373373

374374
if (!$this->checkTokenIn(Token::TK_IDENTIFIER, $types, true)) {
375375
throw new ParserException($this->tokenQueue, sprintf('Invalid property type: %s', $this->tokenQueue->get()->getData()));

src/PHPCR/Util/Console/Command/BaseNodeManipulationCommand.php

+15-5
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,37 @@ abstract class BaseNodeManipulationCommand extends BaseCommand
1717
*/
1818
protected function configureNodeManipulationInput()
1919
{
20-
$this->addOption('set-prop', 'p',
20+
$this->addOption(
21+
'set-prop',
22+
'p',
2123
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
2224
'Set node property on nodes use foo=bar'
2325
);
2426

25-
$this->addOption('remove-prop', 'r',
27+
$this->addOption(
28+
'remove-prop',
29+
'r',
2630
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
2731
'Remove property from nodes'
2832
);
2933

30-
$this->addOption('add-mixin', null,
34+
$this->addOption(
35+
'add-mixin',
36+
null,
3137
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
3238
'Add a mixin to the nodes'
3339
);
3440

35-
$this->addOption('remove-mixin', null,
41+
$this->addOption(
42+
'remove-mixin',
43+
null,
3644
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
3745
'Remove mixin from the nodes'
3846
);
3947

40-
$this->addOption('apply-closure', null,
48+
$this->addOption(
49+
'apply-closure',
50+
null,
4151
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
4252
'Apply a closure to each node, closures are passed PHPCR\Session and PHPCR\NodeInterface'
4353
);

src/PHPCR/Util/Console/Command/NodeDumpCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ protected function configure()
4040
->addOption('ref-format', 'uuid', InputOption::VALUE_REQUIRED, 'Set the way references should be displayed when dumping reference properties - either "uuid" (default) or "path"')
4141
->addArgument('identifier', InputArgument::OPTIONAL, 'Root path to dump', '/')
4242
->setDescription('Dump subtrees of the content repository')
43-
->setHelp(<<<'HERE'
43+
->setHelp(
44+
<<<'HERE'
4445
The <info>dump</info> command recursively outputs the name of the node specified
4546
by the <info>identifier</info> argument and its subnodes in a yaml-like style.
4647

src/PHPCR/Util/Console/Command/NodeMoveCommand.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ protected function configure()
2929
->addArgument('source', InputArgument::REQUIRED, 'Path of node to move')
3030
->addArgument('destination', InputArgument::REQUIRED, 'Destination for node')
3131
->setDescription('Moves a node from one path to another')
32-
->setHelp(<<<'EOF'
32+
->setHelp(
33+
<<<'EOF'
3334
This command simply moves a node from one path (the source path)
3435
to another (the destination path), it can also be considered
3536
as a rename command.
@@ -55,7 +56,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
5556

5657
$output->writeln(sprintf(
5758
'<info>Moving </info>%s<info> to </info>%s',
58-
$sourcePath, $destPath
59+
$sourcePath,
60+
$destPath
5961
));
6062

6163
$session->move($sourcePath, $destPath);

src/PHPCR/Util/Console/Command/NodeRemoveCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ protected function configure()
3636
->addArgument('path', InputArgument::REQUIRED, 'Path of the node to purge')
3737
->addOption('force', null, InputOption::VALUE_NONE, 'Use to bypass the confirmation dialog')
3838
->addOption('only-children', null, InputOption::VALUE_NONE, 'Use to only purge children of specified path')
39-
->setHelp(<<<'EOF'
39+
->setHelp(
40+
<<<'EOF'
4041
The <info>phpcr:node:remove</info> command will remove the given node or the
4142
children of the given node according to the options given.
4243

src/PHPCR/Util/Console/Command/NodeTouchCommand.php

+13-6
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,21 @@ protected function configure()
3939
'Path at which to create the new node'
4040
)
4141
->addOption(
42-
'type', 't',
42+
'type',
43+
't',
4344
InputOption::VALUE_OPTIONAL,
4445
'Node type, default nt:unstructured',
4546
'nt:unstructured'
4647
)
47-
->addOption('dump', 'd',
48+
->addOption(
49+
'dump',
50+
'd',
4851
InputOption::VALUE_NONE,
4952
'Dump a string reperesentation of the created / modified node.'
5053
)
5154
->setDescription('Create or modify a node')
52-
->setHelp(<<<'HERE'
55+
->setHelp(
56+
<<<'HERE'
5357
This command allows you to create or modify a node at the specified path.
5458
5559
For example::
@@ -65,7 +69,7 @@ protected function configure()
6569
6670
$ ./bin/phpcr phpcr:touch /foobar --type=my:nodetype --set-prop=bar=myvalue --remove-prop=foo --dump
6771
HERE
68-
);
72+
);
6973
}
7074

7175
/**
@@ -104,7 +108,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
104108
if ($nodeType != $type) {
105109
$output->writeln(sprintf(
106110
'<error>You have specified node type "%s" but the existing node is of type "%s"</error>',
107-
$type, $nodeType
111+
$type,
112+
$nodeType
108113
));
109114

110115
return 1;
@@ -125,7 +130,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
125130
}
126131

127132
$output->writeln(sprintf(
128-
'<info>Creating node: </info> %s [%s]', $path, $type
133+
'<info>Creating node: </info> %s [%s]',
134+
$path,
135+
$type
129136
));
130137

131138
$node = $parentNode->addNode($nodeName, $type);

src/PHPCR/Util/Console/Command/NodeTypeListCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ protected function configure()
2323
$this
2424
->setName('phpcr:node-type:list')
2525
->setDescription('List all available node types in the repository')
26-
->setHelp(<<<'EOT'
26+
->setHelp(
27+
<<<'EOT'
2728
This command lists all of the available node types and their subtypes
2829
in the PHPCR repository.
2930
EOT

src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ protected function configure()
3636
->setDescription('Register node types in the PHPCR repository')
3737
->addArgument('cnd-file', InputArgument::IS_ARRAY, 'Register namespaces and node types from a "Compact Node Type Definition" .cnd file(s)')
3838
->addOption('allow-update', null, InputOption::VALUE_NONE, 'Overwrite existig node type')
39-
->setHelp(<<<'EOT'
39+
->setHelp(
40+
<<<'EOT'
4041
Register node types in the PHPCR repository.
4142
4243
This command allows to register node types in the repository that are defined

src/PHPCR/Util/Console/Command/NodesUpdateCommand.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,28 @@ protected function configure()
3333

3434
$this->setName('phpcr:nodes:update')
3535
->addOption(
36-
'query', null,
36+
'query',
37+
null,
3738
InputOption::VALUE_REQUIRED,
3839
'Query used to select the nodes'
3940
)
4041
->addOption(
41-
'query-language', 'l',
42+
'query-language',
43+
'l',
4244
InputOption::VALUE_OPTIONAL,
4345
'The query language (e.g. sql, jcr_sql2)',
4446
'jcr-sql2'
4547
)
4648
->addOption(
47-
'persist-counter', 'c',
49+
'persist-counter',
50+
'c',
4851
InputOption::VALUE_OPTIONAL,
4952
'Save the session every x requests',
5053
'100'
5154
)
5255
->setDescription('Command to manipulate the nodes in the workspace.')
53-
->setHelp(<<<HERE
56+
->setHelp(
57+
<<<HERE
5458
The <info>phpcr:nodes:update</info> can manipulate the properties of nodes
5559
found using the given query.
5660
@@ -77,7 +81,7 @@ protected function configure()
7781
For each node in the result set, the closure will be passed the current
7882
<comment>PHPCR\SessionInterface</comment> implementation and the node (<comment>PHPCR\NodeInterface</comment>) as <comment>\$session</comment> and <comment>\$node</comment>.
7983
HERE
80-
);
84+
);
8185
}
8286

8387
/**

src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ protected function configure()
2727
->setName('phpcr:workspace:create')
2828
->addArgument('name', InputArgument::REQUIRED, 'Name of the workspace to create')
2929
->addOption(
30-
'ignore-existing',
31-
null,
32-
InputOption::VALUE_NONE,
33-
'If set, an existing workspace will return a success code'
30+
'ignore-existing',
31+
null,
32+
InputOption::VALUE_NONE,
33+
'If set, an existing workspace will return a success code'
3434
)
3535
->setDescription('Create a workspace in the configured repository')
36-
->setHelp(<<<'EOT'
36+
->setHelp(
37+
<<<'EOT'
3738
The <info>workspace:create</info> command creates a workspace with the specified name.
3839
It will fail if a workspace with that name already exists or if the repository implementation
3940
does not support the workspace creation operation.

src/PHPCR/Util/Console/Command/WorkspaceDeleteCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ protected function configure()
2727
->addArgument('name', InputArgument::REQUIRED, 'Name of the workspace to delete')
2828
->addOption('force', null, InputOption::VALUE_NONE, 'Use to bypass the confirmation dialog')
2929
->setDescription('Delete a workspace from the configured repository')
30-
->setHelp(<<<'EOT'
30+
->setHelp(
31+
<<<'EOT'
3132
The <info>workspace:delete</info> command deletes the workspace with the specified name if it
3233
exists. If the workspace with that name does not yet exist, the command will not fail.
3334
However, if the workspace does exist but the repository implementation does not support

src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ protected function configure()
3131
->addOption('skip_binary', null, InputOption::VALUE_OPTIONAL, 'Set to "yes" to skip binaries', 'no')
3232
->addOption('recurse', null, InputOption::VALUE_OPTIONAL, 'Set to "no" to prevent recursion', 'yes')
3333
->setDescription('Export nodes from the repository, either to the JCR system view format or the document view format')
34-
->setHelp(<<<'EOF'
34+
->setHelp(
35+
<<<'EOF'
3536
The <info>export</info> command uses the PHPCR SessionInterface::exportSystemView
3637
method to export parts of the repository into an XML document.
3738

src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ protected function configure()
3737
->addOption('parentpath', 'p', InputOption::VALUE_OPTIONAL, 'Repository path to the parent where to import the file contents', '/')
3838
->addOption('uuid-behavior', null, InputOption::VALUE_REQUIRED, 'How to handle UUID collisions during the import', 'new')
3939
->setDescription('Import xml data into the repository, either in JCR system view format or arbitrary xml')
40-
->setHelp(<<<'EOF'
40+
->setHelp(
41+
<<<'EOF'
4142
The <info>import</info> command uses the PHPCR SessionInterface::importXml method
4243
to import an XML document into the repository. If the document is in the JCR
4344
system view format, it is interpreted according to the spec, otherwise it is

src/PHPCR/Util/Console/Command/WorkspaceListCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ protected function configure()
2222
$this
2323
->setName('phpcr:workspace:list')
2424
->setDescription('List all available workspaces in the configured repository')
25-
->setHelp(<<<'EOT'
25+
->setHelp(
26+
<<<'EOT'
2627
The <info>workspace:list</info> command lists all avaialable workspaces.
2728
EOT
2829
);

src/PHPCR/Util/Console/Command/WorkspacePurgeCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ protected function configure()
2828
->setName('phpcr:workspace:purge')
2929
->setDescription('Remove all nodes from a workspace')
3030
->addOption('force', null, InputOption::VALUE_NONE, 'Use to bypass the confirmation dialog')
31-
->setHelp(<<<'EOF'
31+
->setHelp(
32+
<<<'EOF'
3233
The <info>phpcr:workspace:purge</info> command removes all nodes except the
3334
system nodes and all non-system properties of the root node from the workspace.
3435
EOF

src/PHPCR/Util/Console/Helper/PhpcrHelper.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public function processNode(OutputInterface $output, NodeInterface $node, array
7676
$parts = explode('=', $set);
7777
$output->writeln(sprintf(
7878
'<comment> > Setting property </comment>%s<comment> to </comment>%s',
79-
$parts[0], $parts[1]
79+
$parts[0],
80+
$parts[1]
8081
));
8182
$node->setProperty($parts[0], $parts[1]);
8283
}
@@ -134,7 +135,8 @@ public function processNode(OutputInterface $output, NodeInterface $node, array
134135
if (!is_string($value)) {
135136
$value = print_r($value, true);
136137
}
137-
$output->writeln(sprintf('<comment> - %s = </comment>%s',
138+
$output->writeln(sprintf(
139+
'<comment> - %s = </comment>%s',
138140
$property->getName(),
139141
$value
140142
));
@@ -181,7 +183,8 @@ protected function validateQueryLanguage($language)
181183

182184
throw new Exception(sprintf(
183185
'Query language "%s" not supported, available query languages: %s',
184-
$language, implode(',', $langs)
186+
$language,
187+
implode(',', $langs)
185188
));
186189
}
187190
}

src/PHPCR/Util/PathHelper.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ public static function getNodeName($path)
272272

273273
if (false === $strrpos) {
274274
self::error(sprintf(
275-
'Path "%s" must be an absolute path', $path
275+
'Path "%s" must be an absolute path',
276+
$path
276277
), true);
277278
}
278279

src/PHPCR/Util/QOM/BaseQomToSqlQueryConverter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ protected function convertPropertyExistence(QOM\PropertyExistenceInterface $cons
143143
{
144144
return $this->generator->evalPropertyExistence(
145145
$constraint->getSelectorName(),
146-
$constraint->getPropertyName());
146+
$constraint->getPropertyName()
147+
);
147148
}
148149

149150
/**
@@ -229,7 +230,8 @@ protected function convertPropertyValue(QOM\PropertyValueInterface $value)
229230
{
230231
return $this->generator->evalPropertyValue(
231232
$value->getPropertyName(),
232-
$value->getSelectorName());
233+
$value->getSelectorName()
234+
);
233235
}
234236

235237
/**

src/PHPCR/Util/QOM/QomToSql1QueryConverter.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ protected function convertConstraint(QOM\ConstraintInterface $constraint)
5252
if ($constraint instanceof QOM\AndInterface) {
5353
return $this->generator->evalAnd(
5454
$this->convertConstraint($constraint->getConstraint1()),
55-
$this->convertConstraint($constraint->getConstraint2()));
55+
$this->convertConstraint($constraint->getConstraint2())
56+
);
5657
}
5758

5859
if ($constraint instanceof QOM\OrInterface) {
5960
return $this->generator->evalOr(
6061
$this->convertConstraint($constraint->getConstraint1()),
61-
$this->convertConstraint($constraint->getConstraint2()));
62+
$this->convertConstraint($constraint->getConstraint2())
63+
);
6264
}
6365

6466
if ($constraint instanceof QOM\NotInterface) {
@@ -81,12 +83,14 @@ protected function convertConstraint(QOM\ConstraintInterface $constraint)
8183

8284
if ($constraint instanceof QOM\ChildNodeInterface) {
8385
return $this->generator->evalChildNode(
84-
$this->convertPath($constraint->getParentPath()));
86+
$this->convertPath($constraint->getParentPath())
87+
);
8588
}
8689

8790
if ($constraint instanceof QOM\DescendantNodeInterface) {
8891
return $this->generator->evalDescendantNode(
89-
$this->convertPath($constraint->getAncestorPath()));
92+
$this->convertPath($constraint->getAncestorPath())
93+
);
9094
}
9195

9296
// This should not happen, but who knows...

0 commit comments

Comments
 (0)