Skip to content

Commit 8127d74

Browse files
authored
Merge pull request #194 from phpcr/analysis-wj9pMZ
Apply fixes from StyleCI
2 parents 5aaecc7 + 69e1924 commit 8127d74

File tree

9 files changed

+114
-59
lines changed

9 files changed

+114
-59
lines changed

inc/AbstractLoader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ public function doesSessionLastModified()
255255
*/
256256
public function getTestSupported($chapter, $case, $name)
257257
{
258-
return !(in_array($chapter, $this->unsupportedChapters)
258+
return !(
259+
in_array($chapter, $this->unsupportedChapters)
259260
|| in_array($case, $this->unsupportedCases)
260261
|| in_array($name, $this->unsupportedTests)
261-
);
262+
);
262263
}
263264

264265
/**

inc/BaseCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ protected function assertSimilarDateTime($expected, $data)
278278
{
279279
$this->assertInstanceOf(DateTime::class, $expected);
280280
$this->assertInstanceOf(DateTime::class, $data);
281-
$this->assertTrue(abs($expected->getTimestamp() - $data->getTimestamp()) <= 3,
281+
$this->assertTrue(
282+
abs($expected->getTimestamp() - $data->getTimestamp()) <= 3,
282283
$data->format('c').' is not close to the expected '.$expected->format('c')
283284
);
284285
}

tests/Observation/ObservationManagerTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ protected function expectEvents(EventJournalInterface $journal, $startDate)
410410

411411
// Adding a node will cause a NODE_ADDED + PROPERTY_ADDED (for the primary node type)
412412
// The order is implementation specific (Jackrabbit will trigger the prop added before the node added event)
413-
$this->expectEventsInAnyOrder($journal,
413+
$this->expectEventsInAnyOrder(
414+
$journal,
414415
[
415416
[EventInterface::NODE_ADDED, $this->nodePath.'/child'],
416417
[EventInterface::PROPERTY_ADDED, $this->nodePath.'/child/jcr%3aprimaryType'],
@@ -454,7 +455,8 @@ protected function expectEvents(EventJournalInterface $journal, $startDate)
454455

455456
// Same problem as before. Moving a node will cause a NODE_REMOVED + NODE_ADDED + NODE_MOVED
456457
// The order of the events is implementation specific.
457-
$events = $this->expectEventsInAnyOrder($journal,
458+
$events = $this->expectEventsInAnyOrder(
459+
$journal,
458460
[
459461
[EventInterface::NODE_REMOVED, $this->nodePath.'/child'],
460462
[EventInterface::NODE_ADDED, $this->nodePath.'/moved'],

tests/Query/CharacterTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public function testPropertyWithBackslash()
3030
{
3131
/** @var QueryManagerInterface $queryManager */
3232
$queryManager = $this->sharedFixture['qm'];
33-
$query = $queryManager->createQuery('
33+
$query = $queryManager->createQuery(
34+
'
3435
SELECT data.class
3536
FROM [nt:unstructured] AS data
3637
WHERE data.class = "PHPCR\Query\QueryInterface"',
@@ -51,7 +52,8 @@ public function testPropertyWithDoubleBackslash()
5152
{
5253
/** @var QueryManagerInterface $queryManager */
5354
$queryManager = $this->sharedFixture['qm'];
54-
$query = $queryManager->createQuery('
55+
$query = $queryManager->createQuery(
56+
'
5557
SELECT data.doublebackslash
5658
FROM [nt:unstructured] AS data
5759
WHERE data.doublebackslash = "PHPCR\\\\Query\\\\QueryInterface"',
@@ -72,7 +74,8 @@ public function testPropertyWithQuotes()
7274
{
7375
/** @var QueryManagerInterface $queryManager */
7476
$queryManager = $this->sharedFixture['qm'];
75-
$query = $queryManager->createQuery(sprintf('
77+
$query = $queryManager->createQuery(
78+
sprintf('
7679
SELECT data.quotes
7780
FROM [nt:unstructured] AS data
7881
WHERE data.quotes = "%s"
@@ -94,7 +97,8 @@ public function testPropertyWithQuotesAndBackslash()
9497
{
9598
/** @var QueryManagerInterface $queryManager */
9699
$queryManager = $this->sharedFixture['qm'];
97-
$query = $queryManager->createQuery(sprintf('
100+
$query = $queryManager->createQuery(
101+
sprintf('
98102
SELECT data.quoteandbackslash
99103
FROM [nt:unstructured] AS data
100104
WHERE data.quoteandbackslash = "%s"
@@ -113,7 +117,8 @@ public function testQueryWithColon()
113117
{
114118
/** @var QueryManagerInterface $queryManager */
115119
$queryManager = $this->sharedFixture['qm'];
116-
$query = $queryManager->createQuery('
120+
$query = $queryManager->createQuery(
121+
'
117122
SELECT data.property
118123
FROM [nt:unstructured] AS data
119124
WHERE data.property = "foo:bar"
@@ -128,7 +133,8 @@ public function testQueryWithAmpersand()
128133
{
129134
/** @var QueryManagerInterface $queryManager */
130135
$queryManager = $this->sharedFixture['qm'];
131-
$query = $queryManager->createQuery('
136+
$query = $queryManager->createQuery(
137+
'
132138
SELECT data.ampersand
133139
FROM [nt:unstructured] AS data
134140
WHERE data.ampersand = "foo & bar&baz"

tests/Query/QOM/QomTestQueries.php

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
5151
$factory->selector('file', 'nt:file'),
5252
$factory->selector('folder', 'nt:folder'),
5353
Constants::JCR_JOIN_TYPE_INNER,
54-
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')),
54+
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')
55+
),
5556
null,
5657
[],
5758
[]
@@ -65,7 +66,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
6566
$factory->selector('file', 'nt:file'),
6667
$factory->selector('folder', 'nt:folder'),
6768
Constants::JCR_JOIN_TYPE_LEFT_OUTER,
68-
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')),
69+
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')
70+
),
6971
null,
7072
[],
7173
[]
@@ -79,7 +81,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
7981
$factory->selector('file', 'nt:file'),
8082
$factory->selector('folder', 'nt:folder'),
8183
Constants::JCR_JOIN_TYPE_RIGHT_OUTER,
82-
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')),
84+
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')
85+
),
8386
null,
8487
[],
8588
[]
@@ -98,7 +101,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
98101
),
99102
$factory->selector('folder2', 'nt:folder'),
100103
Constants::JCR_JOIN_TYPE_INNER,
101-
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')),
104+
$factory->equiJoinCondition('file', 'prop1', 'folder', 'prop2')
105+
),
102106
null,
103107
[],
104108
[]
@@ -116,7 +120,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
116120
$factory->selector('file', 'nt:file'),
117121
$factory->selector('folder', 'nt:folder'),
118122
Constants::JCR_JOIN_TYPE_INNER,
119-
$factory->sameNodeJoinCondition('file', 'folder')),
123+
$factory->sameNodeJoinCondition('file', 'folder')
124+
),
120125
null,
121126
[],
122127
[]
@@ -130,7 +135,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
130135
$factory->selector('file', 'nt:file'),
131136
$factory->selector('folder', 'nt:folder'),
132137
Constants::JCR_JOIN_TYPE_INNER,
133-
$factory->sameNodeJoinCondition('file', 'folder', '/home')),
138+
$factory->sameNodeJoinCondition('file', 'folder', '/home')
139+
),
134140
null,
135141
[],
136142
[]
@@ -148,7 +154,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
148154
$factory->selector('child', 'nt:file'),
149155
$factory->selector('parent', 'nt:folder'),
150156
Constants::JCR_JOIN_TYPE_INNER,
151-
$factory->childNodeJoinCondition('child', 'parent')),
157+
$factory->childNodeJoinCondition('child', 'parent')
158+
),
152159
null,
153160
[],
154161
[]
@@ -166,7 +173,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
166173
$factory->selector('descendant', 'nt:file'),
167174
$factory->selector('ancestor', 'nt:folder'),
168175
Constants::JCR_JOIN_TYPE_INNER,
169-
$factory->descendantNodeJoinCondition('descendant', 'ancestor')),
176+
$factory->descendantNodeJoinCondition('descendant', 'ancestor')
177+
),
170178
null,
171179
[],
172180
[]
@@ -322,7 +330,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
322330
$factory->selector('file', 'nt:file'),
323331
$factory->andConstraint(
324332
$factory->propertyExistence('file', 'prop1'),
325-
$factory->propertyExistence('file', 'prop2')),
333+
$factory->propertyExistence('file', 'prop2')
334+
),
326335
[],
327336
[]
328337
)
@@ -338,7 +347,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
338347
$factory->selector('file', 'nt:file'),
339348
$factory->orConstraint(
340349
$factory->propertyExistence('file', 'prop1'),
341-
$factory->propertyExistence('file', 'prop2')),
350+
$factory->propertyExistence('file', 'prop2')
351+
),
342352
[],
343353
[]
344354
)
@@ -353,7 +363,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
353363
$factory->createQuery(
354364
$factory->selector('file', 'nt:file'),
355365
$factory->notConstraint(
356-
$factory->propertyExistence('file', 'prop1')),
366+
$factory->propertyExistence('file', 'prop1')
367+
),
357368
[],
358369
[]
359370
)
@@ -370,7 +381,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
370381
$factory->comparison(
371382
$factory->nodeName('file'),
372383
Constants::JCR_OPERATOR_LIKE,
373-
$factory->literal('literal2')),
384+
$factory->literal('literal2')
385+
),
374386
[],
375387
[]
376388
)
@@ -472,7 +484,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
472484
$factory->comparison(
473485
$factory->propertyValue('file', 'prop'),
474486
Constants::JCR_OPERATOR_LIKE,
475-
$factory->literal('literal')),
487+
$factory->literal('literal')
488+
),
476489
[],
477490
[]
478491
)
@@ -485,7 +498,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
485498
$factory->comparison(
486499
$factory->propertyValue('sel', 'prop'),
487500
Constants::JCR_OPERATOR_GREATER_THAN,
488-
$factory->literal(new \DateTime('2013-04-15 +02:00'))),
501+
$factory->literal(new \DateTime('2013-04-15 +02:00'))
502+
),
489503
[],
490504
[]
491505
)
@@ -502,7 +516,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
502516
$factory->comparison(
503517
$factory->length($factory->propertyValue('file', 'prop')),
504518
Constants::JCR_OPERATOR_LIKE,
505-
$factory->literal('literal')),
519+
$factory->literal('literal')
520+
),
506521
[],
507522
[]
508523
)
@@ -519,7 +534,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
519534
$factory->comparison(
520535
$factory->nodeName('file'),
521536
Constants::JCR_OPERATOR_LIKE,
522-
$factory->literal('literal')),
537+
$factory->literal('literal')
538+
),
523539
[],
524540
[]
525541
)
@@ -536,7 +552,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
536552
$factory->comparison(
537553
$factory->nodeLocalName('file'),
538554
Constants::JCR_OPERATOR_LIKE,
539-
$factory->literal('literal')),
555+
$factory->literal('literal')
556+
),
540557
[],
541558
[]
542559
)
@@ -553,7 +570,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
553570
$factory->comparison(
554571
$factory->fullTextSearchScore('file'),
555572
Constants::JCR_OPERATOR_LIKE,
556-
$factory->literal('literal')),
573+
$factory->literal('literal')
574+
),
557575
[],
558576
[]
559577
)
@@ -570,7 +588,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
570588
$factory->comparison(
571589
$factory->lowerCase($factory->nodeName('file')),
572590
Constants::JCR_OPERATOR_LIKE,
573-
$factory->literal('literal')),
591+
$factory->literal('literal')
592+
),
574593
[],
575594
[]
576595
)
@@ -587,7 +606,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
587606
$factory->comparison(
588607
$factory->upperCase($factory->nodeName('file')),
589608
Constants::JCR_OPERATOR_LIKE,
590-
$factory->literal('literal')),
609+
$factory->literal('literal')
610+
),
591611
[],
592612
[]
593613
)
@@ -604,7 +624,8 @@ public static function getQueries(QueryObjectModelFactoryInterface $factory)
604624
$factory->comparison(
605625
$factory->upperCase($factory->nodeName('file')),
606626
Constants::JCR_OPERATOR_LIKE,
607-
$factory->bindVariable('var')),
627+
$factory->bindVariable('var')
628+
),
608629
[],
609630
[]
610631
)

tests/Query/QueryBaseCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function setUp()
4949
{
5050
parent::setUp();
5151

52-
$this->query = $this->sharedFixture['qm']->createQuery('
52+
$this->query = $this->sharedFixture['qm']->createQuery(
53+
'
5354
SELECT *
5455
FROM [nt:folder]
5556
WHERE ISDESCENDANTNODE([/tests_general_base])

tests/Query/QueryResultsTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public function testGetColumnNames()
6868

6969
public function testGetAliasColumnNames()
7070
{
71-
$query = $this->sharedFixture['qm']->createQuery('
71+
$query = $this->sharedFixture['qm']->createQuery(
72+
'
7273
SELECT [jcr:mimeType] AS bar, stringToCompare as foo, [nt:unstructured].longNumberToCompare, ding
7374
FROM [nt:unstructured]
7475
WHERE stringToCompare IS NOT NULL
@@ -163,7 +164,8 @@ public function testReadPropertyContentFromResults()
163164

164165
public function testCompareNumberFields()
165166
{
166-
$query = $this->sharedFixture['qm']->createQuery('
167+
$query = $this->sharedFixture['qm']->createQuery(
168+
'
167169
SELECT data.longNumberToCompare
168170
FROM [nt:unstructured] AS data
169171
WHERE data.longNumberToCompare > 2
@@ -185,7 +187,8 @@ public function testCompareNumberFields()
185187

186188
public function testCompareNumberFieldsMulti()
187189
{
188-
$query = $this->sharedFixture['qm']->createQuery('
190+
$query = $this->sharedFixture['qm']->createQuery(
191+
'
189192
SELECT data.longNumberToCompareMulti
190193
FROM [nt:unstructured] AS data
191194
WHERE data.longNumberToCompareMulti = 2
@@ -230,7 +233,7 @@ public function testBooleanField()
230233
{
231234
$query = $this->sharedFixture['qm']->createQuery(
232235
'SELECT data.thisIsNo FROM [nt:unstructured] as data WHERE data.thisIsNo = false',
233-
QueryInterface::JCR_SQL2
236+
QueryInterface::JCR_SQL2
234237
);
235238
$result = $query->execute();
236239

@@ -245,7 +248,7 @@ public function testBooleanField()
245248

246249
$query = $this->sharedFixture['qm']->createQuery(
247250
'SELECT data.thisIsYes FROM [nt:unstructured] as data WHERE data.thisIsYes = true',
248-
QueryInterface::JCR_SQL2
251+
QueryInterface::JCR_SQL2
249252
);
250253
$result = $query->execute();
251254

0 commit comments

Comments
 (0)