Problem/Motivation
Playing around with https://cs.symfony.com/ I have noticed than some files miss the strict_types=1 directive.
Proposed resolution
Add a minimal .php-cs-fixer.php with:
- drupol\PhpCsFixerConfigsDrupal\Config\Drupal8 config object
declare_strict_types(and the relatedblank_line_after_opening_tag) rule- as a bonus:
ordered_importsrule
Excluding the tests files for now.
Issue fork ui_patterns-3541295
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pdureau commentedDone. It is a risky change? What do we need to check?
Do we also apply this rules to the tests?
Comment #4
pdureau commentedComment #5
grimreaperHello,
TODO:
- Add Gitlab CI task to execute PHPCS Fixer
Let's use the same standards across UI Suite.
This is what I use to stick to PHPCS requirements + a few things not covered by PHP CS:
- "drupol/phpcsfixer-configs-drupal": "^2.2",
- https://gitlab.com/florenttorregrosa-drupal/docker-drupal-project/-/blob...
Comment #6
pdureau commentedit is a risky change !!! For example, i have now this issue:
Uncaught PHP Exception TypeError: "Drupal\ui_patterns\Element\ComponentFormBase::getSources(): Argument #1 ($prop_or_slot_id) must be of type string, int given, called in web/modules/custom/ui_patterns/src/Element/ComponentSlotForm.php on line 284" at web/modules/custom/ui_patterns/src/Element/ComponentFormBase.php line 170Comment #7
pdureau commentedComment #10
just_like_good_vibes