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 workflow + PHPStan fixes #339

Merged
merged 8 commits into from
Jun 11, 2024
Merged

Conversation

DjordyKoert
Copy link
Contributor

I noticed that PHPStan was available but not actually being used.

This PR contains a few changes & fixes, namely:

  • PHPStan is now ran in CI
  • Added PHPStan script (running PHPStan locally)
  • A bunch of fixes that I encountered while running PHPStan locally
    • I was not able to fix some though because I don't have the required knowledge of these parts (or maybe some of these are actually bugged currently) . These should be added to baseline or fixed if someone knows how to.
 ------ -------------------------------------------------------------------------------------- 
  Line   Filament/Resources/UserResource/Pages/EditProfile.php                                 
 ------ -------------------------------------------------------------------------------------- 
  142    Access to an undefined property chillerlan\QRCode\QROptions::$svgLogo.                
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property  
  143    Access to an undefined property chillerlan\QRCode\QROptions::$svgLogoScale.           
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property  
  147    Access to protected property chillerlan\QRCode\QROptions::$version.                   
  149    Access to protected property chillerlan\QRCode\QROptions::$outputBase64.              
  150    Access to protected property chillerlan\QRCode\QROptions::$eccLevel.                  
  151    Access to protected property chillerlan\QRCode\QROptions::$addQuietzone.              
  153    Access to protected property chillerlan\QRCode\QROptions::$connectPaths.              
  154    Access to protected property chillerlan\QRCode\QROptions::$drawCircularModules.       
  157    Access to protected property chillerlan\QRCode\QROptions::$svgDefs.                   
 ------ -------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------- 
  Line   Models/Node.php                                                                       
 ------ -------------------------------------------------------------------------------------- 
  242    Access to an undefined property App\Models\Node::$servers_sum_memory.                 
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property  
  249    Access to an undefined property App\Models\Node::$servers_sum_disk.                   
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property  
  256    Access to an undefined property App\Models\Node::$servers_sum_cpu.                    
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property  
 ------ -------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   Services/Deployment/FindViableNodesService.php                                                                                                                 
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  30     Parameter #1 $value of function collect expects Illuminate\Contracts\Support\Arrayable<(int|string), mixed>|iterable<(int|string), mixed>|null, string given.  
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 13 errors    

@lancepioch
Copy link
Member

Thanks for the work, I'm going to convert this into a draft until it's ready!

@lancepioch lancepioch marked this pull request as draft June 7, 2024 04:02
.github/workflows/lint.yaml Outdated Show resolved Hide resolved
.github/workflows/lint.yaml Show resolved Hide resolved
@DjordyKoert
Copy link
Contributor Author

@Boy132 I see that you have opened #343 to fix the remaining issues. Should the current errors be added to a phpstan baseline or will this be merged with a failing PHPStan job?

@Boy132
Copy link
Member

Boy132 commented Jun 7, 2024

@Boy132 I see that you have opened #343 to fix the remaining issues. Should the current errors be added to a phpstan baseline or will this be merged with a failing PHPStan job?

We will properly merge #343 first and then your PR. Then all phpstan errors should be fixed.

lancepioch added a commit that referenced this pull request Jun 9, 2024
Fix remaining phpstan issues for #339
# Conflicts:
#	app/Filament/Resources/EggResource/Pages/ListEggs.php
#	app/Filament/Resources/ServerResource/Pages/CreateServer.php
@DjordyKoert DjordyKoert marked this pull request as ready for review June 11, 2024 10:56
@DjordyKoert DjordyKoert requested a review from Boy132 June 11, 2024 10:56
Copy link
Member

@Boy132 Boy132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

composer.json Outdated Show resolved Hide resolved
@lancepioch lancepioch merged commit 1d66d4c into pelican-dev:main Jun 11, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
@pelican-dev pelican-dev deleted a comment from github-actions bot Oct 31, 2024
@pelican-dev pelican-dev deleted a comment from DjordyKoert Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants