Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan is not passing on develop #6999

Closed
Miraeld opened this issue Oct 1, 2024 · 1 comment
Closed

PHPStan is not passing on develop #6999

Miraeld opened this issue Oct 1, 2024 · 1 comment
Assignees
Labels
priority: high Issues which should be resolved as quickly as possible type: bug Indicates an unexpected problem or unintended behavior

Comments

@Miraeld
Copy link
Contributor

Miraeld commented Oct 1, 2024

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug

PHPStan isn't passing anymore.

 ------ ----------------------------------------------------------------------------------------------------------------------------- 
  Line   inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/Regex.php                                                       
 ------ ----------------------------------------------------------------------------------------------------------------------------- 
  37     Property WP_Rocket\Engine\Optimization\LazyRenderContent\Frontend\Processor\Regex::$exclusions is never read, only written.  
         💡 See: https://phpstan.org/developing-extensions/always-read-written-properties                                             
 ------ ----------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------- 
  Line   inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/SimpleHtmlDom.php                                                       
 ------ ------------------------------------------------------------------------------------------------------------------------------------- 
  40     Property WP_Rocket\Engine\Optimization\LazyRenderContent\Frontend\Processor\SimpleHtmlDom::$exclusions is never read, only written.  
         💡 See: https://phpstan.org/developing-extensions/always-read-written-properties                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------------- 

To Reproduce
No way to reproduce, except running composer run-stan.

Expected behavior
No errors should happen with phpstan

Solution

We should add a /* @phpstan-ignore-line */ to both errors as the reason is only because we are using the DOM to process LRC and at the moment we are keeping other solutions in case.
As this 2 others solutions aren't used, it detects these properties as not used.

@Miraeld Miraeld added type: bug Indicates an unexpected problem or unintended behavior priority: high Issues which should be resolved as quickly as possible labels Oct 1, 2024
@Miraeld Miraeld self-assigned this Oct 1, 2024
@Miraeld
Copy link
Contributor Author

Miraeld commented Oct 1, 2024

It will be fixed with #6996

@Miraeld Miraeld closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Issues which should be resolved as quickly as possible type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant