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:

Excluding the tests files for now.

Command icon 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

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Needs review

Done. It is a risky change? What do we need to check?

Do we also apply this rules to the tests?

pdureau’s picture

Title: [2.0.9] Add missing strict_types=1 diretcives » [2.0.9] Add missing strict_types=1 directives
grimreaper’s picture

Hello,

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...

pdureau’s picture

Status: Needs review » Needs work

It is a risky change? What do we need to check?

it 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 170

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes

just_like_good_vibes made their first commit to this issue’s fork.

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.