Skip to content

Commit 1bd58ce

Browse files
committed
fix CS with the fabpot PHP-CS-Fixer
1 parent 47fdcea commit 1bd58ce

22 files changed

+256
-171
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4646

4747
if (! $session->getRepository()->getDescriptor(\PHPCR\RepositoryInterface::OPTION_WORKSPACE_MANAGEMENT_SUPPORTED)) {
4848
$output->writeln('<error>Your PHPCR implemenation does not support workspace management. Please refer to the documentation of your PHPCR implementation to learn how to create a workspace.</error>');
49+
4950
return 1;
5051
}
5152

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPCR\Util\Console\Command;
44

5-
65
use Symfony\Component\Console\Command\Command;
76
use Symfony\Component\Console\Input\InputArgument;
87
use Symfony\Component\Console\Input\InputOption;
@@ -87,6 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8786

8887
if (!$session->nodeExists($path)) {
8988
$output->writeln("<error>Path '$path' does not exist</error>");
89+
9090
return 1;
9191
}
9292

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5151
$session = $this->getHelper('phpcr')->getSession();
5252
if (! $session->getRepository()->getDescriptor(RepositoryInterface::OPTION_XML_EXPORT_SUPPORTED)) {
5353
$output->writeln('<error>This repository does not support xml export</error>');
54+
5455
return 1;
5556
}
5657

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace PHPCR\Util\Console\Command;
44

55
use Symfony\Component\Console\Command\Command;
6-
use Symfony\Component\Console\Input\InputArgument;
76
use Symfony\Component\Console\Input\InputInterface;
87
use Symfony\Component\Console\Input\InputOption;
98
use Symfony\Component\Console\Output\OutputInterface;
@@ -53,6 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5352
$session = $this->getHelper('phpcr')->getSession();
5453
if (! $session->getRepository()->getDescriptor(RepositoryInterface::OPTION_XML_IMPORT_SUPPORTED)) {
5554
$output->writeln('<error>This repository does not support xml import</error>');
55+
5656
return 1;
5757
}
5858

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace PHPCR\Util\Console\Command;
44

55
use Symfony\Component\Console\Command\Command;
6-
use Symfony\Component\Console\Input\InputArgument;
76
use Symfony\Component\Console\Input\InputInterface;
87
use Symfony\Component\Console\Output\OutputInterface;
98

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7676
$this->updateFromCnd($input, $output, $session, $cnd, $allowUpdate);
7777
} catch (\Exception $e) {
7878
$output->writeln('<error>'.$e->getMessage().'</error>');
79+
7980
return 1;
8081
}
8182

@@ -88,10 +89,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
8889
* Actually do the update.
8990
*
9091
* @param SessionInterface $session the phpcr session to talk to
91-
* @param string $cnd the compact namespace and node type definition in string form
92+
* @param string $cnd the compact namespace and node type definition in string form
9293
*
9394
* @throws \PHPCR\NodeType\NodeTypeExistsException if the node already exists and allowUpdate is false
94-
* @throws \PHPCR\RepositoryException on other errors
95+
* @throws \PHPCR\RepositoryException on other errors
9596
*/
9697
protected function updateFromCnd(InputInterface $input, OutputInterface $output, SessionInterface $session, $cnd, $allowUpdate)
9798
{

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ class ConsoleParametersParser
1010
/**
1111
* Return true if $value is a string that can be considered as true.
1212
* I.e. if it is case insensitively "true" or "yes".
13-
* @param string $value
13+
* @param string $value
1414
* @return boolean
1515
*/
1616
public static function isTrueString($value)
1717
{
1818
$value = strtolower($value);
19+
1920
return $value === 'true' || $value === 'yes';
2021
}
2122

2223
/**
2324
* Return true if $value is a string that can be considered as false.
2425
* I.e. if it is case insensitively "false" or "no".
25-
* @param string $value
26+
* @param string $value
2627
* @return boolean
2728
*/
2829
public static function isFalseString($value)
2930
{
3031
$value = strtolower($value);
32+
3133
return $value === 'false' || $value === 'no';
3234
}
3335
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ public function getName()
3535
return 'phpcr';
3636
}
3737
}
38-

src/PHPCR/Util/NodeHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private function __construct()
2424
* Create a node and it's parents, if necessary. Like mkdir -p.
2525
*
2626
* @param SessionInterface $session the phpcr session to create the path
27-
* @param string $path full path, like /content/jobs/data
27+
* @param string $path full path, like /content/jobs/data
2828
*
2929
* @return PHPCR\NodeInterface the last node of the path, i.e. data
3030
*/
@@ -79,6 +79,7 @@ public static function deleteAllNodes(SessionInterface $session)
7979
public static function isSystemItem(ItemInterface $item)
8080
{
8181
$name = $item->getName();
82+
8283
return strpos($name, 'jcr:') === 0 || strpos($name, 'rep:') === 0;
8384
}
8485
}

src/PHPCR/Util/QOM/BaseQomToSqlQueryConverter.php

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
namespace PHPCR\Util\QOM;
44

55
use PHPCR\Query\QOM;
6-
use PHPCR\Query\QOM\QueryObjectModelConstantsInterface as Constants;
76

87
abstract class BaseQomToSqlQueryConverter
98
{
109
/**
11-
* @var \PHPCR\Util\QOM\Sql2Generator
10+
* @var Sql2Generator
1211
*/
1312
protected $generator;
1413

@@ -23,7 +22,8 @@ public function __construct(BaseSqlGenerator $generator)
2322
* ['WHERE' Constraint]
2423
* ['ORDER BY' orderings]
2524
*
26-
* @param \PHPCR\Query\QOM\QueryObjectModelInterface $query
25+
* @param QOM\QueryObjectModelInterface $query
26+
*
2727
* @return string
2828
*/
2929
public function convert(QOM\QueryObjectModelInterface $query)
@@ -44,11 +44,17 @@ public function convert(QOM\QueryObjectModelInterface $query)
4444
return $this->generator->evalQuery($source, $columns, $constraint, $orderings);
4545
}
4646

47+
abstract protected function convertSource(QOM\SourceInterface $source);
48+
49+
abstract protected function convertConstraint(QOM\ConstraintInterface $constraint);
50+
51+
abstract protected function convertDynamicOperand(QOM\DynamicOperandInterface $operand);
52+
4753
/**
4854
* Selector ::= nodeTypeName ['AS' selectorName]
4955
* nodeTypeName ::= Name
5056
*
51-
* @param \PHPCR\Query\QOM\SelectorInterface $selector
57+
* @param QOM\SelectorInterface $selector
5258
* @return string
5359
*/
5460
protected function convertSelector(QOM\SelectorInterface $selector)
@@ -70,7 +76,7 @@ protected function convertSelector(QOM\SelectorInterface $selector)
7076
* GreaterThanOrEqualTo ::= '>='
7177
* Like ::= 'LIKE'
7278
*
73-
* @param \PHPCR\Query\QOM\ComparisonInterface $comparison
79+
* @param QOM\ComparisonInterface $comparison
7480
* @return string
7581
*/
7682
protected function convertComparison(QOM\ComparisonInterface $comparison)
@@ -92,7 +98,7 @@ protected function convertComparison(QOM\ComparisonInterface $comparison)
9298
* Note: The negation, 'NOT x IS NOT NULL'
9399
* can be written 'x IS NULL'
94100
*
95-
* @param \PHPCR\Query\QOM\PropertyExistenceInterface $constraint
101+
* @param QOM\PropertyExistenceInterface $constraint
96102
* @return string
97103
*/
98104
protected function convertPropertyExistence(QOM\PropertyExistenceInterface $constraint)
@@ -111,34 +117,34 @@ protected function convertPropertyExistence(QOM\PropertyExistenceInterface $cons
111117
* explicit specification of the selectorName
112118
* preceding the propertyName is optional
113119
*
114-
* @param \PHPCR\Query\QOM\FullTextSearchInterface $constraint
120+
* @param QOM\FullTextSearchInterface $constraint
115121
* @return string
116122
*/
117123
protected function convertFullTextSearch(QOM\FullTextSearchInterface $constraint)
118124
{
119125
$searchExpression = $this->convertFullTextSearchExpression($constraint->getFullTextSearchExpression());
126+
120127
return $this->generator->evalFullTextSearch($constraint->getSelectorName(), $searchExpression, $constraint->getPropertyName());
121128
}
122129

123130
/**
124131
* FullTextSearchExpression ::= BindVariable | ''' FullTextSearchLiteral '''
125132
*
126-
* @param string $expr
133+
* @param string $expr
127134
* @return string
128135
*/
129136
protected function convertFullTextSearchExpression($literal)
130137
{
131-
if ($literal instanceof QOM\BindVariableValue) {
138+
if ($literal instanceof QOM\BindVariableValueInterface) {
132139
return $this->convertBindVariable($literal);
133140
}
134-
if ($literal instanceof QOM\Literal) {
141+
if ($literal instanceof QOM\LiteralInterface) {
135142
return $this->convertLiteral($literal);
136143
}
137144

138145
return "'$literal'";
139146
}
140147

141-
142148
/**
143149
* StaticOperand ::= Literal | BindVariableValue
144150
*
@@ -154,7 +160,7 @@ protected function convertFullTextSearchExpression($literal)
154160
* BindVariableValue ::= '$'bindVariableName
155161
* bindVariableName ::= Prefix
156162
*
157-
* @param \PHPCR\Query\QOM\StaticOperandInterface $operand
163+
* @param QOM\StaticOperandInterface $operand
158164
* @return string
159165
*/
160166
protected function convertStaticOperand(QOM\StaticOperandInterface $operand)
@@ -173,7 +179,7 @@ protected function convertStaticOperand(QOM\StaticOperandInterface $operand)
173179
/**
174180
* PropertyValue ::= [selectorName'.'] propertyName // If only one selector exists
175181
*
176-
* @param \PHPCR\Query\QOM\PropertyValueInterface $value
182+
* @param QOM\PropertyValueInterface $value
177183
* @return string
178184
*/
179185
protected function convertPropertyValue(QOM\PropertyValueInterface $operand)
@@ -183,20 +189,20 @@ protected function convertPropertyValue(QOM\PropertyValueInterface $operand)
183189
$operand->getSelectorName());
184190
}
185191

186-
187192
/**
188193
* orderings ::= Ordering {',' Ordering}
189194
* Ordering ::= DynamicOperand [Order]
190195
* Order ::= Ascending | Descending
191196
* Ascending ::= 'ASC'
192197
* Descending ::= 'DESC'
193198
*
194-
* @param array $orderings
199+
* @param QOM\OrderingInterface[] $orderings
195200
* @return string
196201
*/
197202
protected function convertOrderings(array $orderings)
198203
{
199204
$list = array();
205+
/** @var $ordering QOM\OrderingInterface */
200206
foreach ($orderings as $ordering) {
201207
$order = $this->generator->evalOrder($ordering->getOrder());
202208
$operand = $this->convertDynamicOperand($ordering->getOperand());
@@ -230,12 +236,13 @@ protected function convertLiteral($literal)
230236
* propertyName ::= Name
231237
* columnName ::= Name
232238
*
233-
* @param array $columns
239+
* @param QOM\ColumnInterface[] $columns
234240
* @return string
235241
*/
236242
protected function convertColumns(array $columns)
237243
{
238244
$list = array();
245+
/** @var $column QOM\ColumnInterface */
239246
foreach ($columns as $column) {
240247
$selector = $column->getSelectorName();
241248
$property = $column->getPropertyName();

0 commit comments

Comments
 (0)