Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
phpstan.phar | 2025-10-10 | 25.4 MB | |
phpstan.phar.asc | 2025-10-10 | 833 Bytes | |
2.1.31 source code.tar.gz | 2025-10-10 | 3.9 MB | |
2.1.31 source code.zip | 2025-10-10 | 3.9 MB | |
README.md | 2025-10-10 | 7.4 kB | |
Totals: 5 Items | 33.2 MB | 0 |
Bleeding edge 🔪
- AssignToByRefExprFromForeachRule (level 1) (https://github.com/phpstan/phpstan-src/commit/0624342656d2770c99853d0a468304b4348bd129), [#13625], [#11120]
- Validate curl_setopt_array parameter array (#4395), [#13615], thanks @staabm!
- Restrict accepted args of
php_uname()
(#4359), thanks @dktapps! array_rand()
requires anon-empty-array
as of PHP 8 (#4397), thanks @staabm!- Report implicit (inherited) too-wide
@throws
type (https://github.com/phpstan/phpstan-src/commit/3eaad7f46dc6d732e47e3086dabceddf14abc16f)
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon
:
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Improvements 🔧
- New config parameter
exceptions.check.throwTypeCovariance
(https://github.com/phpstan/phpstan-src/commit/3f7e878a5477bdf2e0804f39c8a6c2e949dffdb6), [#13649] - New config parameter
checkTooWideThrowTypesInProtectedAndPublicMethods
(https://github.com/phpstan/phpstan-src/commit/9fc483d89412b79c9caf085c39689c6310fcdef6), [#13258] -
- made TooWideMethodThrowTypeRule behaviour similar to TooWideMethodReturnTypehintRule
-
- made TooWidePropertyHookThrowTypeRule to be similar to TooWideMethodReturnTypehintRule (https://github.com/phpstan/phpstan-src/commit/67ef20bea0ca5855f5500b2b28a2d3c17cc0cde1)
- Useful tip about what
@throws
should be added when the implicit one is too wide (https://github.com/phpstan/phpstan-src/commit/803104076c690dfcffd9ddbb6d3318d74e1cb527) - Relax strict printf parameter check (#4400), thanks @schlndh!
- Support union types in curl_setopt validation (#4396), thanks @staabm!
- Do not report non existent offset for invalid ones (#4398), thanks @VincentLanglet!
- Report float and null offset based on PHP version (#4406), [#13592], thanks @VincentLanglet!
Bugfixes 🐛
- Fix list type lost in for loop (#4403), [#12807], thanks @staabm!
- Improve support of FILTER_REQUIRE_ARRAY (#4410), [#11863], thanks @VincentLanglet!
- Add VersionCompareFunctionDynamicThrowTypeExtension (#4408), [#13515], thanks @VincentLanglet!
- Fix
OversizedArrayType::isSubTypeOf()
(#4407), [#13509], thanks @VincentLanglet! - Fix "array_rand() - offset might not exists" (#4383), [#12981], thanks @staabm!
- Avoid crashing on enum without value (#4336) (#4336), [#7927], thanks @VincentLanglet!
- Special-case LateResolvableType in
UnionType::isSuperTypeOf()
(https://github.com/phpstan/phpstan-src/commit/47a820bf3d43e29140592eec84a1cf36530e0625), [#13652], [#11033] - Object with dynamic property assignments cannot report too-wide types on properties (https://github.com/phpstan/phpstan-src/commit/851ab2c3f6151ca0a12bbceaa063ed0fd162e4cb), [#13624]
- Setting array offset on a property should pick types from original UnionType still present in the current property type (https://github.com/phpstan/phpstan-src/commit/a8cae55bcbab4ddb1529abaa83947cd6f0968ecf), [#13654], [#7880]
- Do not compile special DI container for workers (https://github.com/phpstan/phpstan-src/commit/8fd0fdac262bc9c28d8b975ca6f29cf238a5da8d)
- This should solve occasional errors like:
Warning: rename(phpstan/cache/nette.configurator/Container_be4038c220.php.tmp,phpstan/cache/nette.configurator/Container_be4038c220.php): No such file or directory in phar:///vendor/phpstan/phpstan/phpstan.phar/vendor/nette/di/src/DI/ContainerLoader.php on line 68
Unable to create file 'phpstan/cache/nette.configurator/Container_be4038c220.php'.
- Result cache - fix restoring errors from stub files (#4424), [#12826]
- DefaultStubFilesProvider - normalize stub file paths (https://github.com/phpstan/phpstan-src/commit/d78a5d86c3c00a62790be81d65355d4ca344ff39, https://github.com/phpstan/phpstan-src/commit/e4e4eaac23fc3c22465956775cf4732378ad0bb7)
- Exclude first-party stubs from validation (#4190), thanks @blyxxyz!
- Overriding
@property
tags - take native type into account if the scope can read the native property (https://github.com/phpstan/phpstan-src/commit/bc20ce4686f9b79e1334ec61448b5a97192a87a1), [#13537] - Infer
mixed~array<mixed> | array<string>
(#4425) (#4425), [#13628], [#12930], thanks @VincentLanglet! - Fix reportNestedTooWideType (improve
UnionType::traverseSimultaneously()
) (https://github.com/phpstan/phpstan-src/commit/6597ef616bbb4de57f5946ed02a45a3f82e712c5)
Function signature fixes 🤖
- Fix extract signature (#4402), [#13434], thanks @VincentLanglet!
- Improve is_resource inference (#4411), [#10394], thanks @VincentLanglet!
- Mark redis method as impure (#4409), [#10215], thanks @VincentLanglet!
- Dynamic DOM return type (#4354), [#9200], thanks @VincentLanglet!
- Fix XDOMPath::query() return type (#4373), [#13595], thanks @stefanfisk!
Internals 🔍
- MutatingScope::unsetExpression can be private (https://github.com/phpstan/phpstan-src/commit/a2ebe49840fb6fd53fe955447b60e283e111e1f5)
- Reduce visibility of some methods to private (#4404), thanks @staabm!
- Get rid of
instanceof *Type
checks (#4405), thanks @staabm! - Fix PHP version and grammar in README.md (#4420), thanks @spawnia!
- Use
UnionType::filterTypes()
in one more place (https://github.com/phpstan/phpstan-src/commit/3e78ccf846ee09f798aa46459f835536fa95cf02) - Revert "Narrow type on setting offsets of properties" (https://github.com/phpstan/phpstan-src/commit/4c36e114224d43a558a6f65960f9737da845e083)
- No longer needed after https://github.com/phpstan/phpstan-src/commit/a8cae55bcbab4ddb1529abaa83947cd6f0968ecf
- Extract ParentMethodHelper (https://github.com/phpstan/phpstan-src/commit/d072ced5e3fae3910737cc60fd99fa192bef494a)