- Issue created by @larowlan
- Merge request !500Issues/3495129: Add a normalize method to prop sources. → (Merged) created by Akhil Babu
- 🇮🇳India Akhil Babu Chengannur
As suggested by @larowan, I have added a new method toArray() to the prop source classes
- First commit to issue fork.
- 🇬🇧United Kingdom longwave UK
Made some improvements:
toArray()
is abstract on the base class (we don't have an interface)__toString()
is moved to the base class to avoid repetition- Also added JSON_THROW_ON_ERROR to appease PHPStan
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Nice improvement 🙌 - merge on green, re-ran the failing e2e 🤞
- 🇺🇸United States tedbow Ithaca, NY, USA
Looks good, I can't merge it until @wim leers or @f.mazeikis approves the merge request
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Title did not match actual MR.
Also: +1, this is long overdue!
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Can't run phpstan locally while testing what I'm doing, due to:
$ php vendor/bin/phpstan analyze modules/contrib/experience_builder --memory-limit=256M --configuration=modules/contrib/experience_builder/phpstan.neon -vvv Invalid entries in excludePaths: Path /Users/wim.leers/core/modules/contrib/experience_builder/modules/same_page_preview is neither a directory, nor a file path, nor a fnmatch pattern. Path /Users/wim.leers/core/modules/contrib/experience_builder/tests/src/Cypress/node_modules is neither a directory, nor a file path, nor a fnmatch pattern. If the excluded path can sometimes exist, append (?) to its config entry to mark it as optional.
Fix: remove the first one, because it's obsolete. Make the second one optional.
This must be the new PHPStan version that Drupal
11.x
HEAD is installing — CI is pinning to11.1.x
since that is the current minor, and hence it's not spotting this problem. Doing that here is a distraction, so opened 📌 CI: also test against next minor: 11.2.x aka Drupal 11.x HEAD Active to do that. - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Fortunately, the PHPStan shape work was already done — I'd forgotten about that!
I did also find one more place where we can use the new method 🥳
-
wim leers →
committed dbaa44f4 on 0.x authored by
akhil babu →
Issue #3495129 by wim leers, akhil babu, longwave, larowlan, tedbow: Add...
-
wim leers →
committed dbaa44f4 on 0.x authored by
akhil babu →
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
@wim w.r.t phpstan locally, I've got a `phpstan.larowlan.neon` and inside it I have
includes: - phpstan.neon parameters: scanDirectories: - ../metatag excludePaths: - tests/src/Cypress/node_modules/flatted/php/flatted.php
I've added this to .git/info/exclude so it doesn't get checked in.
In my pre-commit hooks I've got this (the ../../../bin/phpstan is the path in my setup to the phpstan binary)
../../../bin/phpstan analyse -c ./phpstan.larowlan.neon .
This lets me tweak the phpstan setup without impacting the checked in version.
I've got similar things for phpcs and cspell too, also in my pre-commit
Happy to share if they're useful
Automatically closed - issue fixed for 2 weeks with no activity.