Skip to content

[5.2] Adding phpstan to drone setup#43819

Closed
Hackwar wants to merge 3 commits intojoomla:5.2-devfrom
Hackwar:5.2-phpstan2
Closed

[5.2] Adding phpstan to drone setup#43819
Hackwar wants to merge 3 commits intojoomla:5.2-devfrom
Hackwar:5.2-phpstan2

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Jul 21, 2024

Summary of Changes

This PR adds the phpstan static code analyser to our composer dependencies and to our drone setup. It is configured to ignore a series of false positives and to list all deprecations as well. Its configuration file is excluded from the build script. For now phpstan is only set to scan in level 0. When all reports from that are fixed, we can raise that level gradually. Since phpstan will throw failures for a long time, failures are set to be ignored in drone.

phpstan also allows to register a baseline of errors right now and then throw errors when the result differs from that baseline, but that is something for the future.

Testing Instructions

See phpstan step in drone and its results.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@Hackwar Hackwar added the RTC This Pull Request is Ready To Commit label Jul 22, 2024
@laoneo
Copy link
Member

laoneo commented Jul 24, 2024

To get the fully power of PHPStan, you should add a minimal bootstrap file to discover more symbols as I did in DPDocker here.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 24, 2024
@laoneo
Copy link
Member

laoneo commented Aug 14, 2024

#43919 is a more enhanced alternative to this one.

@Hackwar
Copy link
Member Author

Hackwar commented Aug 15, 2024

Since we have a better version of this, closing this one. Thanks @laoneo!

@Hackwar Hackwar closed this Aug 15, 2024
@Hackwar Hackwar deleted the 5.2-phpstan2 branch August 15, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments