In our quality tools, we enforce respecting Symfony's coding standards by runnig PHP CS fixer with one rule set : https://cs.symfony.com/doc/ruleSets/Symfony.html
When running CS fixer on Skipper generated Entities with attributes, the fixer alters the attributes on 4 different rules (see bellow).
When running Skipper generation again, the attributes are regenerated with Skipper's rules.
example of the "issue"
Skipper generated :
#[ORM\Table(name: "table_1",
options: [
"comment"=>"Long comment multiline",
"row_format"=>"XY"
])]
#[ORM\Table(name: "table_2",
options: ["comment"=>"Short comment","row_format"=>"XY"])]
PHP CS fixer "fixes" :
#[ORM\Table(name: 'table_1',
options: [
'comment' => "Long comment multiline",
'row_format'=> 'XY',
])]
#[ORM\Table(name: 'table_2',
options: ['comment'=>'Short comment', 'row_format'=>'XY'])]
Propositions
A. Add a configuration to Skipper to run a post-generation script per Entity passing the Class as argument, like this
$ php vendor/bin/php-cs-fixer fix src/Entity/Person.php
B. Add a configuration to setup Skipper to respect the 4 rules bellow
Rules for reference
single_quote
https://cs.symfony.com/doc/rules/string_notation/single_quote.html
whitespaceaftercommainarray
https://cs.symfony.com/doc/rules/array_notation/whitespace_after_comma_in_array.html
trailingcommain_multiline
https://cs.symfony.com/doc/rules/control_structure/trailing_comma_in_multiline.html
binaryoperatorspaces
https://cs.symfony.com/doc/rules/operator/binary_operator_spaces.html
Side quest A
targetEntity could probably use ::class constant instead of explicit FQDN
#[ORM\ManyToMany(targetEntity: "App\Entity\Stakeholder\Organization", mappedBy: 'activities')]
could probably be replaced by
#[ORM\ManyToMany(targetEntity: Organization:class, mappedBy: 'activities')]
given the namespaces matches or the related entity is imported
but I am not sure about it and haven't tested it for now.
*To be honest, it is PHP Rector who proposed this fix when it ran it with this config https://getrector.org/blog/how-to-upgrade-annotations-to-attributes
Side quest B
named arguments order should match parameters order
Example:
#[ORM\ManyToMany(targetEntity: Organization:class, mappedBy: 'activities')]
should be
#[ORM\ManyToMany(mappedBy: 'activities', targetEntity: Organization:class)]
according to \Doctrine\ORM\Mapping\OneToMany::__construct
new OneToMany($mappedBy, $targetEntity, $cascade, $fetch, $orphanRemoval, $indexBy)