- Issue created by @jlbellido
- 🇪🇸Spain jlbellido
I'm attaching the initial report with all the issues detected before fixing anything:
- Merge request !32#3417527: Fix most PHPStan reported issues. Provide initial phpstan.neon file. → (Open) created by jlbellido
- 🇪🇸Spain jlbellido
Hello,
I've created an initial MR fixing most of the errors reported. It still pending the following one:
------ --------------------------------------------------------------------- Line modules/file_example/src/FileExampleSubmitHandlerHelper.php ------ --------------------------------------------------------------------- 460 Class Drupal\devel\DevelDumperInterface not found. 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
I don't really know if by using Stub files we can fix it since it is a conditional class not always present (depending is Devel is required or not).
- Status changed to Needs review
5 months ago 1:47pm 28 January 2024 - 🇪🇸Spain jlbellido
I've checked in deep the error from #5 but I think Stub files is not the right way because they are meant for other kind of scenarios according to (https://phpstan.org/user-guide/stub-files). Therefore I don't see other way to get rid of it than ignoring it via php-baseline.neon
I've added a new commit with this approach.
Now we are passing the PHPStan checks for Level 1:
$ php ../vendor/bin/phpstan analyze --configuration modules/contrib/examples/phpstan.neon modules/contrib/examples 242/242 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% [OK] No errors
I think this is now ready to be reviewed.
- last update
5 months ago 186 pass, 13 fail - last update
5 months ago 186 pass, 13 fail - last update
5 months ago 186 pass, 13 fail - 🇪🇸Spain jlbellido
After [#] has been merged, now we can see we are passing the PHPStan check within !32 if we compare it with the last run on the main project (https://git.drupalcode.org/project/examples/-/pipelines/85372)
Therefore I'd say this is fully ready to be reviewed by someone else.
Thanks!