Skip to content

Commit cd1302e

Browse files
author
Wout Gevaert
committed
Add trailing comma to multiline array and cleanup imports in tests
1 parent 69cd5c7 commit cd1302e

17 files changed

+46
-50
lines changed

tests/Unit/Clauses/OptionalMatchTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use PHPUnit\Framework\TestCase;
2525
use TypeError;
2626
use WikibaseSolutions\CypherDSL\Clauses\OptionalMatchClause;
27-
use WikibaseSolutions\CypherDSL\Patterns\Pattern;
2827
use WikibaseSolutions\CypherDSL\Tests\Unit\TestHelper;
2928
use WikibaseSolutions\CypherDSL\Types\AnyType;
3029
use WikibaseSolutions\CypherDSL\Types\StructuralTypes\NodeType;

tests/Unit/Clauses/SetClauseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
use PHPUnit\Framework\TestCase;
2525
use TypeError;
2626
use WikibaseSolutions\CypherDSL\Assignment;
27-
use WikibaseSolutions\CypherDSL\Label;
2827
use WikibaseSolutions\CypherDSL\Clauses\SetClause;
28+
use WikibaseSolutions\CypherDSL\Label;
2929
use WikibaseSolutions\CypherDSL\Tests\Unit\TestHelper;
3030
use WikibaseSolutions\CypherDSL\Types\AnyType;
3131

tests/Unit/ExpressionListTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
namespace WikibaseSolutions\CypherDSL\Tests\Unit;
2323

24-
use TypeError;
2524
use PHPUnit\Framework\TestCase;
25+
use TypeError;
2626
use WikibaseSolutions\CypherDSL\ExpressionList;
2727
use WikibaseSolutions\CypherDSL\Query;
2828

@@ -69,7 +69,7 @@ public function provideOneDimensionalData(): array
6969
return [
7070
[[Query::literal(12)], "[12]"],
7171
[[Query::literal('12')], "['12']"],
72-
[[Query::literal('12'), Query::literal('13')], "['12', '13']"]
72+
[[Query::literal('12'), Query::literal('13')], "['12', '13']"],
7373
];
7474
}
7575

@@ -78,7 +78,7 @@ public function provideMultidimensionalData(): array
7878
return [
7979
[[new ExpressionList([Query::literal(12)])], "[[12]]"],
8080
[[new ExpressionList([Query::literal('12')])], "[['12']]"],
81-
[[new ExpressionList([Query::literal('12'), Query::literal('14')]), new ExpressionList([Query::literal('13')])], "[['12', '14'], ['13']]"]
81+
[[new ExpressionList([Query::literal('12'), Query::literal('14')]), new ExpressionList([Query::literal('13')])], "[['12', '14'], ['13']]"],
8282
];
8383
}
8484

tests/Unit/Functions/RawFunctionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
namespace WikibaseSolutions\CypherDSL\Tests\Unit\Functions;
2323

24-
use TypeError;
2524
use PHPUnit\Framework\TestCase;
25+
use TypeError;
2626
use WikibaseSolutions\CypherDSL\Functions\RawFunction;
2727
use WikibaseSolutions\CypherDSL\Tests\Unit\TestHelper;
2828
use WikibaseSolutions\CypherDSL\Types\AnyType;

tests/Unit/Literals/DecimalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function provideToQueryData(): array
6363
[2, "2"],
6464
[3.14, "3.14"],
6565
[-12, "-12"],
66-
[69, "69"]
66+
[69, "69"],
6767
];
6868
}
6969
}

tests/Unit/Literals/StringLiteralTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function provideSingleQuotesData(): array
104104
["\uffff", "'\\uffff'"],
105105
["\U00000000", "'\\U00000000'"],
106106
["\Uffffffff", "'\\Uffffffff'"],
107-
["\\\\b", "'\\\\b'"]
107+
["\\\\b", "'\\\\b'"],
108108
];
109109
}
110110

@@ -127,7 +127,7 @@ public function provideDoubleQuotesData(): array
127127
["\uffff", "\"\\uffff\""],
128128
["\U00000000", "\"\\U00000000\""],
129129
["\Uffffffff", "\"\\Uffffffff\""],
130-
["\\\\b", "\"\\\\b\""]
130+
["\\\\b", "\"\\\\b\""],
131131
];
132132
}
133133
}

tests/Unit/ParameterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function provideToQueryData(): array
6060
["a", '$a'],
6161
["b", '$b'],
6262
["foo_bar", '$foo_bar'],
63-
["A", '$A']
63+
["A", '$A'],
6464
];
6565
}
6666

@@ -71,7 +71,7 @@ public function provideThrowsExceptionOnInvalidData(): array
7171
["@"],
7272
["!"],
7373
["-"],
74-
['']
74+
[''],
7575
];
7676
}
7777
}

tests/Unit/Patterns/NodeTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,23 +288,23 @@ public function provideOnlyLabelData(): array
288288
return [
289289
['a', '(:a)'],
290290
['A', '(:A)'],
291-
[':', '(:`:`)']
291+
[':', '(:`:`)'],
292292
];
293293
}
294294

295295
public function provideOnlyNameData(): array
296296
{
297297
return [
298298
['a', '(a)'],
299-
['A', '(A)']
299+
['A', '(A)'],
300300
];
301301
}
302302

303303
public function provideWithNameAndLabelData(): array
304304
{
305305
return [
306306
['a', 'a', '(a:a)'],
307-
['A', ':', '(A:`:`)']
307+
['A', ':', '(A:`:`)'],
308308
];
309309
}
310310

@@ -313,7 +313,7 @@ public function provideWithNameAndPropertiesData(): array
313313
return [
314314
['a', ['a' => new StringLiteral('b'), 'b' => new StringLiteral('c')], "(a {a: 'b', b: 'c'})"],
315315
['b', ['a' => new Decimal(0), 'b' => new Decimal(1)], "(b {a: 0, b: 1})"],
316-
['c', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(c {`:`: [1, 'a']})"]
316+
['c', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(c {`:`: [1, 'a']})"],
317317
];
318318
}
319319

@@ -322,7 +322,7 @@ public function provideWithLabelAndPropertiesData(): array
322322
return [
323323
['a', ['a' => new StringLiteral('b'), 'b' => new StringLiteral('c')], "(:a {a: 'b', b: 'c'})"],
324324
['b', ['a' => new Decimal(0), 'b' => new Decimal(1)], "(:b {a: 0, b: 1})"],
325-
['c', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(:c {`:`: [1, 'a']})"]
325+
['c', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(:c {`:`: [1, 'a']})"],
326326
];
327327
}
328328

@@ -331,7 +331,7 @@ public function provideOnlyPropertiesData(): array
331331
return [
332332
[['a' => new StringLiteral('b'), 'b' => new StringLiteral('c')], "({a: 'b', b: 'c'})"],
333333
[['a' => new Decimal(0), 'b' => new Decimal(1)], "({a: 0, b: 1})"],
334-
[[':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "({`:`: [1, 'a']})"]
334+
[[':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "({`:`: [1, 'a']})"],
335335
];
336336
}
337337

@@ -340,7 +340,7 @@ public function provideWithNameAndLabelAndPropertiesData(): array
340340
return [
341341
['a', 'd', ['a' => new StringLiteral('b'), 'b' => new StringLiteral('c')], "(a:d {a: 'b', b: 'c'})"],
342342
['b', 'e', ['a' => new Decimal(0), 'b' => new Decimal(1)], "(b:e {a: 0, b: 1})"],
343-
['c', 'f', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(c:f {`:`: [1, 'a']})"]
343+
['c', 'f', [':' => new ExpressionList([new Decimal(1), new StringLiteral('a')])], "(c:f {`:`: [1, 'a']})"],
344344
];
345345
}
346346

tests/Unit/Patterns/PathTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testRelationshipLong(): void
7373
new Node('Label'),
7474
(new Node())->named('b'),
7575
new Node(),
76-
(new Node())->named('d')
76+
(new Node())->named('d'),
7777
], $path->getNodes());
7878

7979
self::assertEquals([
@@ -83,7 +83,7 @@ public function testRelationshipLong(): void
8383
->withType('TYPE')
8484
->withProperties(['x' => Query::literal('y')])
8585
->named('c'),
86-
new Relationship(Relationship::DIR_UNI)
86+
new Relationship(Relationship::DIR_UNI),
8787
], $path->getRelationships());
8888
}
8989
}

tests/Unit/Patterns/RelationshipTest.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@
2323

2424
use DomainException;
2525
use LogicException;
26-
use PHPUnit\Framework\MockObject\MockObject;
2726
use PHPUnit\Framework\TestCase;
2827
use WikibaseSolutions\CypherDSL\Literals\Decimal;
2928
use WikibaseSolutions\CypherDSL\Literals\StringLiteral;
30-
use WikibaseSolutions\CypherDSL\Patterns\Node;
3129
use WikibaseSolutions\CypherDSL\Patterns\Relationship;
3230
use WikibaseSolutions\CypherDSL\PropertyMap;
3331
use WikibaseSolutions\CypherDSL\Query;
3432
use WikibaseSolutions\CypherDSL\Tests\Unit\TestHelper;
35-
use WikibaseSolutions\CypherDSL\Types\StructuralTypes\StructuralType;
3633

3734
/**
3835
* @covers \WikibaseSolutions\CypherDSL\Patterns\Relationship
@@ -578,7 +575,7 @@ public function provideVariableLengthRelationshipsWithTypeData(): array
578575
return [
579576
['', 1, 100, Relationship::DIR_LEFT, '<-[*1..100]-'],
580577
['a', 10, null, Relationship::DIR_LEFT, '<-[:a*10..]-'],
581-
[':', null, 10, Relationship::DIR_LEFT, '<-[:`:`*..10]-']
578+
[':', null, 10, Relationship::DIR_LEFT, '<-[:`:`*..10]-'],
582579
];
583580
}
584581

@@ -587,7 +584,7 @@ public function provideVariableLengthRelationshipsWithPropertiesData(): array
587584
return [
588585
[[], 10, 100, Relationship::DIR_LEFT, "<-[*10..100 {}]-"],
589586
[[new StringLiteral('a')], 10, null, Relationship::DIR_LEFT, "<-[*10.. {`0`: 'a'}]-"],
590-
[['a' => new StringLiteral('b')], null, 10, Relationship::DIR_LEFT, "<-[*..10 {a: 'b'}]-"]
587+
[['a' => new StringLiteral('b')], null, 10, Relationship::DIR_LEFT, "<-[*..10 {a: 'b'}]-"],
591588
];
592589
}
593590

@@ -598,15 +595,15 @@ public function provideVariableLengthRelationshipsWithNameAndTypeAndPropertiesDa
598595
['b', 'a', [new StringLiteral('a')], null, 10, Relationship::DIR_LEFT, "<-[b:a*..10 {`0`: 'a'}]-"],
599596
['a', 'b', [new StringLiteral('a')], 10, 100, Relationship::DIR_LEFT, "<-[a:b*10..100 {`0`: 'a'}]-"],
600597
['a', '', ['a' => new StringLiteral('b')], null, 10, Relationship::DIR_LEFT, "<-[a*..10 {a: 'b'}]-"],
601-
['a', ':', ['a' => new StringLiteral('b'), new StringLiteral('c')], 10, null, Relationship::DIR_LEFT, "<-[a:`:`*10.. {a: 'b', `0`: 'c'}]-"]
598+
['a', ':', ['a' => new StringLiteral('b'), new StringLiteral('c')], 10, null, Relationship::DIR_LEFT, "<-[a:`:`*10.. {a: 'b', `0`: 'c'}]-"],
602599
];
603600
}
604601

605602
public function provideWithNameData(): array
606603
{
607604
return [
608605
['a', Relationship::DIR_UNI, '-[a]-'],
609-
['a', Relationship::DIR_LEFT, '<-[a]-']
606+
['a', Relationship::DIR_LEFT, '<-[a]-'],
610607
];
611608
}
612609

@@ -615,7 +612,7 @@ public function provideWithTypeData(): array
615612
return [
616613
['', Relationship::DIR_LEFT, '<-[]-'],
617614
['a', Relationship::DIR_LEFT, '<-[:a]-'],
618-
[':', Relationship::DIR_LEFT, '<-[:`:`]-']
615+
[':', Relationship::DIR_LEFT, '<-[:`:`]-'],
619616
];
620617
}
621618

@@ -626,7 +623,7 @@ public function provideWithPropertiesData(): array
626623
[[new StringLiteral('a')], Relationship::DIR_LEFT, "<-[{`0`: 'a'}]-"],
627624
[['a' => new StringLiteral('b')], Relationship::DIR_LEFT, "<-[{a: 'b'}]-"],
628625
[['a' => new StringLiteral('b'), new StringLiteral('c')], Relationship::DIR_LEFT, "<-[{a: 'b', `0`: 'c'}]-"],
629-
[[':' => new Decimal(12)], Relationship::DIR_LEFT, "<-[{`:`: 12}]-"]
626+
[[':' => new Decimal(12)], Relationship::DIR_LEFT, "<-[{`:`: 12}]-"],
630627
];
631628
}
632629

@@ -652,7 +649,7 @@ public function provideWithTypeAndPropertiesData(): array
652649
['a', [], Relationship::DIR_LEFT, "<-[:a {}]-"],
653650
['b', [new StringLiteral('a')], Relationship::DIR_LEFT, "<-[:b {`0`: 'a'}]-"],
654651
['', ['a' => new StringLiteral('b')], Relationship::DIR_LEFT, "<-[{a: 'b'}]-"],
655-
[':', ['a' => new StringLiteral('b'), new StringLiteral('c')], Relationship::DIR_LEFT, "<-[:`:` {a: 'b', `0`: 'c'}]-"]
652+
[':', ['a' => new StringLiteral('b'), new StringLiteral('c')], Relationship::DIR_LEFT, "<-[:`:` {a: 'b', `0`: 'c'}]-"],
656653
];
657654
}
658655

@@ -663,7 +660,7 @@ public function provideWithNameAndTypeAndPropertiesData(): array
663660
['b', 'a', [new StringLiteral('a')], Relationship::DIR_LEFT, "<-[b:a {`0`: 'a'}]-"],
664661
['a', 'b', [new StringLiteral('a')], Relationship::DIR_LEFT, "<-[a:b {`0`: 'a'}]-"],
665662
['a', '', ['a' => new StringLiteral('b')], Relationship::DIR_LEFT, "<-[a {a: 'b'}]-"],
666-
['a', ':', ['a' => new StringLiteral('b'), new StringLiteral('c')], Relationship::DIR_LEFT, "<-[a:`:` {a: 'b', `0`: 'c'}]-"]
663+
['a', ':', ['a' => new StringLiteral('b'), new StringLiteral('c')], Relationship::DIR_LEFT, "<-[a:`:` {a: 'b', `0`: 'c'}]-"],
667664
];
668665
}
669666

@@ -673,7 +670,7 @@ public function provideWithMultipleTypesData(): array
673670
['a', [], [], Relationship::DIR_LEFT, "<-[a {}]-"],
674671
['b', ['a'], [new StringLiteral('a')], Relationship::DIR_LEFT, "<-[b:a {`0`: 'a'}]-"],
675672
['a', ['a', 'b', 'c'], [new StringLiteral('a')], Relationship::DIR_LEFT, "<-[a:a|b|c {`0`: 'a'}]-"],
676-
['a', ['a', 'b'], [], Relationship::DIR_LEFT, "<-[a:a|b {}]-"]
673+
['a', ['a', 'b'], [], Relationship::DIR_LEFT, "<-[a:a|b {}]-"],
677674
];
678675
}
679676
}

0 commit comments

Comments
 (0)