neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 220 forks source link

Fix PHPStan baseline #5112

Closed bwaidelich closed 1 month ago

bwaidelich commented 1 month ago

Without this change, composer lint runs into

Error: Ignored error pattern #^Parameter \#2 \$length of function fread expects int\<0, max\>, int given\.$# in path /home/runner/work/neos-development-collection/neos-development-collection/neos-development-distribution/Packages/Neos/Neos.Neos/Classes/ResourceManagement/NodeTypesStreamWrapper.php was not matched in reported errors.
Error: Parameter #2 $length of function fread expects int<1, max>, int given.
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Neos.Neos/Classes/ResourceManagement/NodeTypesStreamWrapper.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         Ignored error pattern #^Parameter \#2 \$length of function fread
         expects int<0, max>, int given\.$# in path
         /home/runner/work/neos-development-collection/neos-development-collection/neos-development-distribution/Packages/Neos/Neos.Neos/Classes/ResourceManagement/NodeTypesStreamWrapper.php
         was not matched in reported errors.
  337    Parameter #2 $length of function fread expects int<1, max>, int
         given.
         🪪  argument.type
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
kitsunet commented 1 month ago

Interesting phpstan because (apart from being relatively pointless) I don't see why 0 shouldn't work

kitsunet commented 1 month ago

Mmm now I get the exact other error, it seems fine without your PR for me? Is this a stan or a php version thing? (PHP 8.3.7)

kitsunet commented 1 month ago

Alright, stan (minor version change :/ WHY), now I got it too.

bwaidelich commented 1 month ago

minor version change :/ WHY

That's how it works. We decided not to pin the version so that we get those changes quick and iteratively. It has the cost that we need to tweak code and update our PHPStan versions from time to time – But IMO it's worth it

kitsunet commented 1 month ago

I find it a bit unfortunate that the dev collection cannot now say "I need AT LEAST stan 1.11" that information is kinda lost. We might at least update the require-dev even if it has no impact