Skip to content

Commit fcd8af4

Browse files
committed
Add the DoctrineAnnotation rule to the PHP-CS-Fixer config
1 parent a32c60b commit fcd8af4

16 files changed

+68
-54
lines changed

.php_cs.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ $finder = PhpCsFixer\Finder::create()
1717
return PhpCsFixer\Config::create()
1818
->setRiskyAllowed(true)
1919
->setRules([
20+
'@DoctrineAnnotation' => true,
21+
'doctrine_annotation_array_assignment' => [
22+
'operator' => '=',
23+
],
24+
'doctrine_annotation_spaces' => [
25+
'after_array_assignments_equals' => false,
26+
'before_array_assignments_equals' => false,
27+
],
2028
'@Symfony' => true,
2129
'@Symfony:risky' => true,
2230
'array_syntax' => [

tests/Annotation/AnnotatedClass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
* shortName="shortName",
2121
* description="description",
2222
* iri="http://example.com/res",
23-
* itemOperations={"foo":{"bar"}},
24-
* collectionOperations={"bar":{"foo"}},
25-
* attributes={"foo":"bar"}
23+
* itemOperations={"foo"={"bar"}},
24+
* collectionOperations={"bar"={"foo"}},
25+
* attributes={"foo"="bar"}
2626
* )
2727
*
2828
* @author Marcus Speight <[email protected]>

tests/Fixtures/TestBundle/Entity/AbstractDummy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
*
2424
* @author Jérémy Derussé <[email protected]>
2525
*
26-
* @ApiResource(attributes={"filters": {"my_dummy.search", "my_dummy.order", "my_dummy.date"}})
26+
* @ApiResource(attributes={"filters"={"my_dummy.search", "my_dummy.order", "my_dummy.date"}})
2727
* @ORM\Entity
2828
* @ORM\InheritanceType("SINGLE_TABLE")
2929
* @ORM\DiscriminatorColumn(name="discr", type="string", length=16)
30-
* @ORM\DiscriminatorMap({"concrete" = "ConcreteDummy"})
30+
* @ORM\DiscriminatorMap({"concrete"="ConcreteDummy"})
3131
*/
3232
abstract class AbstractDummy
3333
{

tests/Fixtures/TestBundle/Entity/CircularReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Kévin Dunglas <[email protected]>
2525
*
26-
* @ApiResource(attributes={"normalization_context"={"groups": {"circular"}}})
26+
* @ApiResource(attributes={"normalization_context"={"groups"={"circular"}}})
2727
* @ORM\Entity
2828
*/
2929
class CircularReference

tests/Fixtures/TestBundle/Entity/Container.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class Container
3535
/**
3636
* @ApiSubresource
3737
* @ORM\OneToMany(
38-
* targetEntity="Node",
39-
* mappedBy="container",
40-
* indexBy="serial",
41-
* fetch="LAZY",
42-
* cascade={},
43-
* orphanRemoval=false
38+
* targetEntity="Node",
39+
* mappedBy="container",
40+
* indexBy="serial",
41+
* fetch="LAZY",
42+
* cascade={},
43+
* orphanRemoval=false
4444
* )
4545
* @ORM\OrderBy({"serial"="ASC"})
4646
*

tests/Fixtures/TestBundle/Entity/CustomActionDummy.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818

1919
/**
2020
* @ORM\Entity
21-
* @ApiResource(itemOperations={
22-
* "get"={"method"="GET"},
23-
* "custom_normalization"={"route_name"="custom_normalization"}
24-
* }, collectionOperations={
25-
* "get"={"method"="GET"},
26-
* "custom_denormalization"={"route_name"="custom_denormalization"}
27-
* })
21+
* @ApiResource(
22+
* itemOperations={
23+
* "get"={"method"="GET"},
24+
* "custom_normalization"={"route_name"="custom_normalization"}
25+
* },
26+
* collectionOperations={
27+
* "get"={"method"="GET"},
28+
* "custom_denormalization"={"route_name"="custom_denormalization"}
29+
* }
30+
* )
2831
*
2932
* @author Kévin Dunglas <[email protected]>
3033
*/

tests/Fixtures/TestBundle/Entity/DummyCar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
/**
2222
* @ApiResource(
2323
* attributes={
24-
* "normalization_context"={"groups"={"colors"}},
25-
* "filters"={"dummy_car_colors.search_filter"}
24+
* "normalization_context"={"groups"={"colors"}},
25+
* "filters"={"dummy_car_colors.search_filter"}
2626
* }
2727
* )
2828
* @ORM\Entity

tests/Fixtures/TestBundle/Entity/DummyTableInheritance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @ORM\Entity
2222
* @ORM\InheritanceType("JOINED")
2323
* @ORM\DiscriminatorColumn(name="discr", type="string")
24-
* @ORM\DiscriminatorMap({"dummyTableInheritance" = "DummyTableInheritance", "dummyTableInheritanceChild" = "DummyTableInheritanceChild", "dummyTableInheritanceDifferentChild" = "DummyTableInheritanceDifferentChild"})
24+
* @ORM\DiscriminatorMap({"dummyTableInheritance"="DummyTableInheritance", "dummyTableInheritanceChild"="DummyTableInheritanceChild", "dummyTableInheritanceDifferentChild"="DummyTableInheritanceDifferentChild"})
2525
* @ApiResource
2626
*/
2727
class DummyTableInheritance

tests/Fixtures/TestBundle/Entity/DummyTableInheritanceRelated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* @ORM\Entity
2323
* @ApiResource(
2424
* attributes={
25-
* "normalization_context"={"groups"={"default"}},
26-
* "denormalization_context"={"groups"={"default"}}
25+
* "normalization_context"={"groups"={"default"}},
26+
* "denormalization_context"={"groups"={"default"}}
2727
* }
2828
* )
2929
*/

tests/Fixtures/TestBundle/Entity/Foo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @author Vincent Chalamon <[email protected]>
2323
*
2424
* @ApiResource(attributes={
25-
* "order"={"bar", "name": "DESC"}
25+
* "order"={"bar", "name"="DESC"}
2626
* })
2727
* @ORM\Entity
2828
*/

0 commit comments

Comments
 (0)