[PR #339] [MERGED] PHPStan workflow + PHPStan fixes #701

Closed
opened 2026-02-04 18:44:24 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pelican-dev/panel/pull/339
Author: @DjordyKoert
Created: 6/6/2024
Status: Merged
Merged: 6/11/2024
Merged by: @lancepioch

Base: mainHead: phpstan


📝 Commits (8)

📊 Changes

15 files changed (+67 additions, -40 deletions)

View changed files

📝 .github/workflows/lint.yaml (+26 -3)
📝 app/Filament/Resources/EggResource/Pages/ListEggs.php (+0 -1)
📝 app/Filament/Resources/NodeResource/Pages/EditNode.php (+5 -4)
📝 app/Filament/Resources/NodeResource/RelationManagers/AllocationsRelationManager.php (+5 -2)
📝 app/Filament/Resources/ServerResource/Pages/CreateServer.php (+2 -2)
📝 app/Filament/Resources/ServerResource/Pages/EditServer.php (+8 -6)
📝 app/Filament/Resources/ServerResource/Pages/ListServers.php (+1 -7)
📝 app/Filament/Resources/ServerResource/RelationManagers/AllocationsRelationManager.php (+6 -2)
📝 app/Http/Controllers/Api/Application/Servers/ServerManagementController.php (+4 -4)
📝 app/Http/Requests/Api/Application/Mounts/UpdateMountRequest.php (+2 -3)
📝 app/Models/Allocation.php (+2 -1)
📝 app/Models/Server.php (+1 -1)
📝 app/Repositories/Daemon/DaemonServerRepository.php (+3 -3)
📝 app/Transformers/Api/Client/ActivityLogTransformer.php (+1 -1)
📝 composer.json (+1 -0)

📄 Description

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    

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pelican-dev/panel/pull/339 **Author:** [@DjordyKoert](https://github.com/DjordyKoert) **Created:** 6/6/2024 **Status:** ✅ Merged **Merged:** 6/11/2024 **Merged by:** [@lancepioch](https://github.com/lancepioch) **Base:** `main` ← **Head:** `phpstan` --- ### 📝 Commits (8) - [`d2181f1`](https://github.com/pelican-dev/panel/commit/d2181f16df35d9f2cd52a592531b7c1c5e174303) add PHPStan to workflow - [`4090c66`](https://github.com/pelican-dev/panel/commit/4090c66af07442be3c5c37049a55972e3991f100) PHPStan fixes - [`57bd617`](https://github.com/pelican-dev/panel/commit/57bd6177fc1ed2f93f2232568bd939bfffbb8b5e) Remove unused import - [`cc7bded`](https://github.com/pelican-dev/panel/commit/cc7bded677a87d14ded6350aff1c807ed210f4bd) Bump to PHP 8.3 - [`bdf8776`](https://github.com/pelican-dev/panel/commit/bdf8776a2b5116c389b21525a8ad6b7f9719eab3) rename Lint job to Pint - [`473d558`](https://github.com/pelican-dev/panel/commit/473d5584259dfc8293d48e28b6a3369b03d387f4) Merge branch 'refs/heads/main' into phpstan - [`b6f2842`](https://github.com/pelican-dev/panel/commit/b6f2842ea732f06d91e59c85c753c3ebd2436dcf) pint - [`372e27e`](https://github.com/pelican-dev/panel/commit/372e27e1e597456b71b76255833e92d9d2d4ea09) Apply suggestions from code review ### 📊 Changes **15 files changed** (+67 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/lint.yaml` (+26 -3) 📝 `app/Filament/Resources/EggResource/Pages/ListEggs.php` (+0 -1) 📝 `app/Filament/Resources/NodeResource/Pages/EditNode.php` (+5 -4) 📝 `app/Filament/Resources/NodeResource/RelationManagers/AllocationsRelationManager.php` (+5 -2) 📝 `app/Filament/Resources/ServerResource/Pages/CreateServer.php` (+2 -2) 📝 `app/Filament/Resources/ServerResource/Pages/EditServer.php` (+8 -6) 📝 `app/Filament/Resources/ServerResource/Pages/ListServers.php` (+1 -7) 📝 `app/Filament/Resources/ServerResource/RelationManagers/AllocationsRelationManager.php` (+6 -2) 📝 `app/Http/Controllers/Api/Application/Servers/ServerManagementController.php` (+4 -4) 📝 `app/Http/Requests/Api/Application/Mounts/UpdateMountRequest.php` (+2 -3) 📝 `app/Models/Allocation.php` (+2 -1) 📝 `app/Models/Server.php` (+1 -1) 📝 `app/Repositories/Daemon/DaemonServerRepository.php` (+3 -3) 📝 `app/Transformers/Api/Client/ActivityLogTransformer.php` (+1 -1) 📝 `composer.json` (+1 -0) </details> ### 📄 Description 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. ```txt ------ -------------------------------------------------------------------------------------- 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 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 18:44:24 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#701