Skip to content

NEW action PHPStan & 36 little 🐛 fixes#931

Merged
mauteri merged 40 commits intoGatherPress:mainfrom
carstingaxion:try/phpstan-for-wp
Oct 4, 2024
Merged

NEW action PHPStan & 36 little 🐛 fixes#931
mauteri merged 40 commits intoGatherPress:mainfrom
carstingaxion:try/phpstan-for-wp

Conversation

@carstingaxion
Copy link
Copy Markdown
Collaborator

@carstingaxion carstingaxion commented Oct 1, 2024

Description of the Change

WordPress extensions for PHPStan

Static analysis for the WordPress ecosystem.

https://github.com/szepeviktor/phpstan-wordpress

This PR introduces a new GitHub action workflow to run PHPStan incl. the WordPress extension.

On behalf of this static analysis I fixed a lot of little problems. While most of the fixes are simple & self-explanatory, the following 6/36 fixes may need a second pair of eyes:

Closes #

How to test the Change

Compare the results of the first PHPStan test run, with the last run of the same action.

Looking at the Files changed, may not be very helpful for this PR, instead going through the commits one-by-one is recommended here.

Changelog Entry

Added - Introduced PHPStan as automated GitHub action workflow and fixed 36 little(!) 🐛s that became visible, on behalf of this action.

Credits

Props @carstingaxion @mauteri

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

Hello @mauteri , I would call this: 38 chances to not get more trouble, than needed.

@carstingaxion carstingaxion self-assigned this Oct 3, 2024
@carstingaxion carstingaxion changed the title Try/phpstan for wp NEW action PHPStan & n little 🐛 fixes Oct 3, 2024
…y): int, array{$this(GatherPress\Core\Rsvp), 'sort_by_timestamp'} given.
@carstingaxion carstingaxion mentioned this pull request Oct 3, 2024
4 tasks
@carstingaxion
Copy link
Copy Markdown
Collaborator Author

Ok 36/38 done, this was a nice ride through the codebase.


Special invitation to @mauteri : The last two remaining errors need a bit more love.

 ------ -------------------------------------------------------------- 
  Line   core/classes/class-event-rest-api.php                         
 ------ -------------------------------------------------------------- 
  :60    Action callback returns bool but should not return anything.  
         🪪  return.void                                               
 ------ -------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   core/classes/class-rsvp.php                                              
 ------ ------------------------------------------------------------------------- 
  :499   Parameter #3 $group of function wp_cache_set expects string, int given.  
         🪪  argument.type                                                        
 ------ ------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 2 errors                                                                                                 
                                                                                                                        

The second is already described at #933

@carstingaxion carstingaxion changed the title NEW action PHPStan & n little 🐛 fixes NEW action PHPStan & 36 little 🐛 fixes Oct 4, 2024
@carstingaxion carstingaxion requested a review from mauteri October 4, 2024 00:45
@carstingaxion carstingaxion marked this pull request as ready for review October 4, 2024 00:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2024

Preview changes with Playground

You can preview the recent changes for PR#931 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Oct 4, 2024

@carstingaxion I made some more changes. Please look over when you can. Thx!

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Oct 4, 2024

@carstingaxion there was a bug where we only support to 6.6, so we are testing 0.31.0 a bit longer. going to merge this one into it since there's a lot of good bug fixes here.

@mauteri mauteri merged commit 5d4b241 into GatherPress:main Oct 4, 2024
@carstingaxion
Copy link
Copy Markdown
Collaborator Author

@carstingaxion there was a bug where we only support to 6.6, so we are testing 0.31.0 a bit longer. going to merge this one into it since there's a lot of good bug fixes here.

Cool. Thank you!

What bug have been there?
I didn’t read anything else about a new bug.

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Oct 6, 2024

@ajskelton reported and I reproduced that all the GstherPress blocks were broken in the editor in versions under 6.6. I did some debugging and this has actually been an issue since 0.29. It is related to some package updates that were done at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants