Update PHPStan packages
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
phpstan/phpstan | require-dev | minor |
1.10.66 -> 1.12.3
|
phpstan/phpstan-symfony | require-dev | minor |
1.3.9 -> 1.4.9
|
Release Notes
phpstan/phpstan (phpstan/phpstan)
v1.12.3
Improvements 🔧
- PHPStan Pro: debug corrupted PHAR signature message (https://github.com/phpstan/phpstan-src/commit/9815bbba4535b0605aef5b5cb9dd64a63bc44b1f)
Bugfixes 🐛
- Revert "Fix phar.yml workflow" (https://github.com/phpstan/phpstan-src/commit/6973519742ab804f57885c099b74971f465c7b24), #11638
- Refactor
ArrayFilterFunctionReturnTypeReturnTypeExtension
and support first-class callable (#3329), #11337, thanks @takaram! - Prevent resolving conditional types in callable param/return types (#3405), #11472, thanks @rvanvelzen!
- Fix wrongly convertion of
list<T>
toarray{T}
(#3412), #11642, thanks @staabm! - Fix internal error (https://github.com/phpstan/phpstan-src/commit/052f6b130f53ad50f571b81d4d468b0b0026c2fd), #11649
- Missing typehints should be consistently checked on level 6 (https://github.com/phpstan/phpstan-src/commit/e3e80f6c9c246d13e41188d508f0f4afb631b9af), #11657
Function signature fixes 🤖
- Don't prevent checking for
curl_init()
false returns (#3409), #11640, thanks @tscni! - Update phpstorm-stubs and patch (#3393), thanks @VincentLanglet!
Internals 🔍
- The
COMPOSER_ROOT_VERSION
hack should no longer be necessary (#3414) - Add non regression test (#3416), #4960, thanks @VincentLanglet!
- Add non regression test (#3415), #10499, thanks @VincentLanglet!
v1.12.2
Improvements 🔧
- PHP 8.4 - report deprecated implicitly nullable parameter types (https://github.com/phpstan/phpstan-src/commit/9bd027c56330c0f5cc2abab2159549373539583d), #11413
Bugfixes 🐛
- Run
@mixin
class reflection extensions after all other class reflection extensions (https://github.com/phpstan/phpstan-src/commit/c889baa9ec60394e9201b2a7054486c66b40fa9b), #11624, #11342, #10159, https://github.com/larastan/larastan/issues/2032 - RegexArrayShapeMatcher - Don't optimize alternations with optional groups for tagged unions (#3395), #11604, thanks @staabm!
- Narrow array on
count()
withpositive-int
(#3389), thanks @staabm! - Improve narrowing after string functions (#3390), thanks @staabm!
- Add
Type::reverseArray()
(#3344), thanks @herndlm!
Function signature fixes 🤖
Internals 🔍
- Regression test (#3396), #6642, thanks @VincentLanglet!
- Simplify isFloat checks (#3397), thanks @staabm!
v1.12.1
Bleeding edge 🔪
- Check if required file exists (#3294), #3397, thanks @Bellangelo!
- Check generics
@method
@template
tags above traits (https://github.com/phpstan/phpstan-src/commit/aadbf62d3ae4517fc7a212b07130bedcef8d13ac) - Check
@mixin
PHPDoc tag above traits (https://github.com/phpstan/phpstan-src/commit/0d0de946900adf4eb3c799b1b547567536e23147)
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 🔧
- Allow dot-prefixed config files (#3354), thanks @sreichel!
- Respect dist order over dot order (#3379), thanks @VincentLanglet!
- Update PhpStorm stubs + refactor WithoutSideEffectsRule classes (#3377), thanks @VincentLanglet!
- TypeSpecifier: Narrow
(bool) $expr
like$expr != false
(#3380), #8881, #7685, #6006, #10528, thanks @staabm! - TypeSpecifier: Narrow
(string) $expr
like$expr != false
(#3387), thanks @staabm! - TypeSpecifier: Narrow
(int) $expr
like$expr != false
(#3384), thanks @staabm! - TypeSpecifier: Narrow
(float) $expr
like$expr != false
(#3391), thanks @staabm! - Add missing rule to StubValidator (https://github.com/phpstan/phpstan-src/commit/085fcf40fefa63fc3672897276e460a6405206fb)
- Support
@mixin
above traits (https://github.com/phpstan/phpstan-src/commit/f5e2e32932644d61b3745e3b0f2c0910f722a86d)
Bugfixes 🐛
- Fix
array_filter
with callback optional persistance (#3366), #11570, thanks @robotomarvin! - RegexArrayShapeMatcher - infer constant string types in alternations (#3369), #11222, thanks @staabm!
- RegexArrayShapeMatcher - improve type inference in alternations (#3375), thanks @staabm!
- Fix error on offset assignment to specialized strings (#3365), #11572, thanks @staabm!
- Narrow string on
strlen() ==
and===
comparison with integer range (#3342), #11548, thanks @staabm! - Fix
get_debug_type
produces wrong type for anonymous classes with parent (#3374), #11562, thanks @patrickkusebauch! - Fix preserving list when setting union offset type to a ConstantArrayTypeBuilder (#3382), thanks @VincentLanglet!
- Fix
preg_replace()
return type (#3338), #11547, thanks @staabm! - Detect function variadic-ness anywhere deep in the declaration file (#3370), #11559, #4753, thanks @staabm!
- Add DateTimeSubMethodThrowTypeExtension (#3378), #11503, thanks @VincentLanglet!
- Do not report
static
in PHPDoc tags above traits as an error (https://github.com/phpstan/phpstan-src/commit/777a82a0dc9d6a64a709c30a2e5bdb030b634464), #11591 - RegexArrayShapeMatcher - Fix alternations containing a
$
-only case (#3394), #11622, thanks @staabm! - Do not report missing implementation abstract method from trait when it's implicitly implemented by enum (https://github.com/phpstan/phpstan-src/commit/c50b71fd961e9009419b8fddac835b15696f4ff5), #11592
- Fix how well conditional types play with pre-existing
@param-out
variable after assignment (https://github.com/phpstan/phpstan-src/commit/5892e8debfbe2f44306e6707c457665784b7dacd), #11580, #6642
Internals 🔍
- Debugging function -
PHPStan\debugScope()
(https://github.com/phpstan/phpstan-src/commit/5909fb2dc78cbee46927c2cb23f7491dfef34165) - Added regression test (#3368), #7856, thanks @staabm!
- Simplify specifyTypesForConstantBinaryExpression (#3392), thanks @staabm!
- Refactoring: introduce MethodTagTemplateTypeCheck (https://github.com/phpstan/phpstan-src/commit/47a85bf1453a076bade7a30c94c06c0825abca7c)
- Simplify extensions (https://github.com/phpstan/phpstan-src/commit/c47730f1f97e4dc6ca9f120e2675ca709fc1402c)
- Refactoring - extract MixinCheck (https://github.com/phpstan/phpstan-src/commit/57ccd8c4d4b16c7edec4c2c2de8589956de8284d)
- MixinCheck - prepare for trait rules (https://github.com/phpstan/phpstan-src/commit/ba591420c26b174ae561e26aeed01ccf34da9dee)
v1.12.0
Read all about PHPStan 1.12 on phpstan.org »
Major new features 🚀
- Precise type for
$matches
frompreg_match
generally available, out of bleeding edge (https://github.com/phpstan/phpstan-src/commit/bd2cec118592f7c66dff5a7ae28882654daf6468) - PHP 8.4 runtime support
- PHPStan runs on PHP 8.4 without emitting deprecation notices
- Full support for PHP 8.4 including new syntax and rules is coming later, after PHPStan 2.0 release
Bleeding edge 🔪
- More precise types for bcmath function parameters (#2217), thanks @Warxcell!
- Enforce
@no-named-arguments
(https://github.com/phpstan/phpstan-src/commit/74ba8c23696948f2647d880df72f375346f41010), #5968 - Check too wide private property type (https://github.com/phpstan/phpstan-src/commit/7453f4f75fae3d635063589467842aae29d88b54)
- Consider implicit throw points when the only explicit one is Throw_ (https://github.com/phpstan/phpstan-src/commit/22eef6d5ab9a4afafb2305258fea273be6cc06e4)
- Check existing classes in
@param-out
(https://github.com/phpstan/phpstan-src/commit/30c4b9e80f51af8b5f166ba3aae93d8409c9c0ea), #10260 - Check existing classes in
@param-closure-this
(https://github.com/phpstan/phpstan-src/commit/2fa539a39e06bcc3155b109fd8d246703ceb176d), #10933 - Check invalid
@param-closure-this
(https://github.com/phpstan/phpstan-src/commit/95c0a5806c65c975201b9d3a464873f75a04c8b8), #10932 - Check
@param-immediately-invoked-callable
and@param-later-invoked-callable
(https://github.com/phpstan/phpstan-src/commit/580a6add422f4e34191df9e7a77ba1655e914bda), #10932 - Check existing classes in
@phpstan-self-out
(https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9) - Check missing types in
@phpstan-self-out
(https://github.com/phpstan/phpstan-src/commit/892b319f25f04bc1b55c3d0063b607909612fe6d) - Check missing types in local type aliases (https://github.com/phpstan/phpstan-src/commit/ce7ffaf02d624a7fb9d38f8e5dffc9739f1233fc)
- Check nonexistent classes in local type aliases (https://github.com/phpstan/phpstan-src/commit/2485b2e9c129e789ec3b2d7db81ca30f87c63911)
- Check unresolvable types in local type aliases (https://github.com/phpstan/phpstan-src/commit/5f7d12b2fb2809525ab0e96eeae95093204ea4d3)
- Check generics in local type aliases (https://github.com/phpstan/phpstan-src/commit/5a2d4416d94ab77a2a2e7e1bfaba4c5ed2a13c25)
- Check missing types in
@mixin
(https://github.com/phpstan/phpstan-src/commit/3175c81f26fd5bcb4a161b24e774921870ed2533) - Check types in
@property
tags (https://github.com/phpstan/phpstan-src/commit/55ea2ae516df22a071ab873fdd6f748a3af0520e), #10752, #9356 - Check types in
@method
tags (https://github.com/phpstan/phpstan-src/commit/5b7e474680eaf33874b7ed6a227677adcbed9ca5) - Check
@extends
,@implements
,@use
for unresolvable types (https://github.com/phpstan/phpstan-src/commit/2bb528233edb75312614166e282776f279cf2018), #11552
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 🔧
- Internal classes made
final
,@api
classes made@final
(#3264, https://github.com/phpstan/phpstan-src/commit/5baa146510b56c9571b3d85eba71c02d86f683bb) - Repair
PhpParser\Node\Stmt\Class_::isAnonymous()
(#3343), thanks @tscni! - Improve
curl_init()
return type analysis (#3346), thanks @tscni! - StubValidator - added missing rules (https://github.com/phpstan/phpstan-src/commit/7fc5ab8dfb3be8cc0c1daff7c17b6c6d98d8ca7a)
- Do not allow
@phpstan-self-out
above static method (https://github.com/phpstan/phpstan-src/commit/0dfd8217699fc1c4796bcafbf2f6e04137938365) - Check unresolvable types in
@phpstan-self-out
(https://github.com/phpstan/phpstan-src/commit/e182c0662df24e57c81b1d49e22963cad5ff5d13) - Check generics in
@phpstan-self-out
(https://github.com/phpstan/phpstan-src/commit/9ebc315589ba2086279dd4c404ef77a33f8b43a7) - ConstExprNodeResolver - support ConstFetchNode for class constants (https://github.com/phpstan/phpstan-src/commit/3e51899dd7ed0e2785846f8ec820b4cd8214b993) - allowed in default parameter values in
@method
Bugfixes 🐛
- PHPStanDiagnoseExtension - skip showing config files in "Included configs from Composer packages" if already present in the "Extension installer" section (https://github.com/phpstan/phpstan-src/commit/6c4477c9fcc2d62579cb1e353ca902b4b9ebb888)
- Support multiple anonymous class definitions on the same line (#3328), #5597, #11511, thanks @tscni!
- Fix ConstantArrayType not accepting NeverType (#3327), #11517, thanks @tscni!
- Narrow to non-falsy-string from
strlen()
on integer range (#3337), thanks @staabm! - Narrow arrays in union based on
count()
with integer range (#3335), thanks @staabm! - Fix description escaping in UsedTraitsRule (https://github.com/phpstan/phpstan-src/commit/4ffbb3b126d3c98fad4ad0906c76d24febdb89ed)
Internals 🔍
- Cleanup TypeSpecifier (#3340), thanks @staabm!
- Refactor ReplaceFunctionsDynamicReturnTypeExtension (#3339), thanks @staabm!
- BetterReflectionSourceLocator - playground mode (https://github.com/phpstan/phpstan-src/commit/7d1bde44afc0c0f7e3b29f2d75a7c33d5e6a56ec)
- Internal PHPStan rule - class must be abstract or final (https://github.com/phpstan/phpstan-src/commit/d631120bea6af099cdcc85e3e12dc9f26bf6f1f5)
- Downgrade PHP files in build/PHPStan (https://github.com/phpstan/phpstan-src/commit/fe503cad77b684f845a932644007c50684161b8d)
- ExtendedPropertyReflection (https://github.com/phpstan/phpstan-src/commit/d65138a11f0654b710a27b4b563bff2ccf0b2c1b)
- Replace
highlight_string()
stub with a return type extension (#3350) - Issue bot - test PHP 8.4 (#3358)
v1.11.11
Improvements 🔧
- Narrow arrays in union based on count() with smaller/greater operator (#3324), #11480, thanks @staabm!
- PHPStanDiagnoseExtension - show Composer packages with included config files (https://github.com/phpstan/phpstan-src/commit/58d202fddc5597a1fa274ca3b64c352717818c4f)
Bugfixes 🐛
- RegexArrayShapeMatcher - optional non-last groups can be empty-string (#3306), #11479, thanks @staabm!
- RegexArrayShapeMatcher - fix capturing item-array-shapes for preg_match_all (#3307), thanks @staabm!
- RegexArrayShapeMatcher - Fix shape of single top level alternations (#3299), #11462, thanks @staabm!
- RegexArrayShapeMatcher - Fix matching literal "-" in character classes (#3314), #11490, thanks @staabm!
- Improve sprintf support (#3310), #11491, thanks @VincentLanglet!
- Handle union and mixed in plus operation (#3320), #3759, thanks @VincentLanglet!
- Fix union with float should accept integer range (#3318), #10248, thanks @VincentLanglet!
- Fix array_intersect_key (#3317), #10561, thanks @VincentLanglet!
- Improve non strict
in_array()
(#3319), #9436, thanks @VincentLanglet! - String offset access leads to non-empty-string (single character) (https://github.com/phpstan/phpstan-src/commit/9439bba42047ab9561a091292568d7adf58e42ce), #11506
- Fix
AccessoryLiteralStringType::setOffsetValueType()
(https://github.com/phpstan/phpstan-src/commit/93c5226cb5711c8b1b846fcfe6d5ef2586d2b162) - Fix
AccessoryNonFalsyStringType::setOffsetValueType()
(https://github.com/phpstan/phpstan-src/commit/c28c9362376286044b37755bedf49ab2228801dc) - Improve IntDivThrowTypeExtension to support integer ranges (#3325), thanks @VincentLanglet!
- Fix array intersection between HasOffsetType and HasOffsetValueType (https://github.com/phpstan/phpstan-src/commit/07d64058830765dbb3bf194cffdf66c98db20a38), #11518
- Fix item type in list to constant array conversion with
count()
(#3309), thanks @staabm!
Function signature fixes 🤖
- Fix imagick definition (#3316), #10803, thanks @VincentLanglet!
Internals 🔍
v1.11.10
Bleeding edge 🔪
- Precise array shape for
preg_replace_callback()
$matches
(#3281), thanks @staabm! - Report invalid exclude paths in PHP config (https://github.com/phpstan/phpstan-src/commit/9718c14f1ffac81ba3d2bf331b4e8b4041a4d004)
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 🔧
- Allow nonexistent paths in excludePaths by appending
(?)
(https://github.com/phpstan/phpstan-src/commit/39649c2b9db016edabdb813dfe39ae0fd46e0c09, https://github.com/phpstan/phpstan-src/commit/be65babffe40c48c303411abf8a56116a274b893), #11436 - Do not report nonexistent paths in ignoreErrors if
reportUnmatchedIgnoredErrors: false
(https://github.com/phpstan/phpstan-src/commit/b7fe9900d5933ffdbdeeb2b10877fd2764cb8bb8), #11436 - Narrow tagged unions based on
count()
with array size (#3302), thanks @staabm!
Bugfixes 🐛
- RegularExpressionPatternRule: fix false positive in preg_quote() handling (#3280), #11432, thanks @staabm!
- Support literal strings in RegexGroupParser (#3284), thanks @staabm!
- Support classes of literal strings in RegexGroupParser (#3285), thanks @staabm!
- Don't infer constant types for "i"-modfied patterns (#3288), thanks @staabm!
- Support non-falsy-string in RegexGroupParser (#3289), thanks @staabm!
- RegexGroupParser: Ignore whitespaces on "x"-modified patterns (#3291) (#3291), thanks @staabm!
- RegexArrayShapeMatcher: fix preg_match_all with PREG_OFFSET_CAPTURE (#3292), #11457, thanks @staabm!
- RegexArrayShapeMatcher - Fix subject types (#3300), thanks @staabm!
- Fix
ConstantArrayType::isSuperTypeOf()
for empty array (https://github.com/phpstan/phpstan-src/commit/ed6bc0b93499b5c7463ba05aefb1377b9eb9d1e0) - is_resource: adjust type specification for truthy context only (#3298), #9687, thanks @janedbal!
- Fix loose comparison between '1' and '+1' (#3301), thanks @thg2k!
Function signature fixes 🤖
- Update some mysqli function return types (#3279), #8345, thanks @mattschlosser!
Internals 🔍
- Extracted RegexGroupParser from RegexArrayShapeMatcher (#3278), thanks @staabm!
- E2E test about path validation in ignoreErrors and excludePaths (https://github.com/phpstan/phpstan-src/commit/9246976958fb22e3464f7a25ef2ab97caed5aa44)
- RegularExpressionPatternRuleTest: utilize
preg_match()
array shape tests (#3290), thanks @staabm! - Simplify RegexArrayShapeMatcher (#3293), thanks @staabm!
- Refactor RegexGroupParser - extract RegexAlternation class (#3296), thanks @staabm!
v1.11.9
Bleeding edge 🔪
- RegularExpressionPatternRule: validate preg_quote'd patterns (#3270), thanks @staabm!
- No implicit wildcard in FileExcluder (https://github.com/phpstan/phpstan-src/commit/e19e6e5f8cfa706cc30e44a17276a6bc269f995c), #10299
- Precise array shape for
preg_match_all()
$matches (#3256), thanks @staabm!
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 🔧
- DefaultStubFilesProvider - consider all composerAutoloaderProjectPaths when filtering 3rd party stub files (https://github.com/phpstan/phpstan-src/commit/582a0f8a744fa2ebda2d98783c55c78183e8bbed), #11393
Bugfixes 🐛
- RegexArrayShapeMatcher: Fix non-emptiness of leading optional groups (#3267), #11376, thanks @staabm!
- RegexArrayShapeMatcher: Support resolving of constants in patterns (#3265), #11384, thanks @staabm!
- RegexExpressionHelper - Support all bracket style delimiters (#3273), thanks @staabm!
- Regex parsing fixes for newline characters and marker verbs (#3268), #11360, #8948, thanks @Seldaek!
- RegexArrayShapeMatcher - Support 'n' modifier (#3271), thanks @staabm!
- Improve
abs()
return type (#3263), #11367, thanks @julienfalque! - UselessFunctionReturnValueRule: More precise error message (#3266), #11377, thanks @staabm!
Internals 🔍
- Extract RegexExpressionHelper (#3270), thanks @staabm!
- Refactor RegexArrayShapeMatcher (#3274), thanks @staabm!
v1.11.8
Bleeding edge 🔪
- Report useless return values of function calls like
var_export
without$return=true
(#3225), #11320, thanks @staabm! - Check mixed in binary operator (#3231), #7538, #10440, thanks @schlndh!
- Check vprintf/vsprintf arguments against placeholder count (#3126), thanks @staabm!
- Check mixed in unary operator (#3253), thanks @schlndh!
- Report "missing return" error closer to where the return is missing (https://github.com/phpstan/phpstan-src/commit/04f8636e6577cbcaefc944725eed74c0d7865ead)
- Stricter ++/-- operator check (#3255), thanks @schlndh!
- Check preg_quote delimiter sanity (#3252), #11338, thanks @staabm!
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 🔧
- Precise array shape for
$matches
frompreg_match()
improvements:- RegexArrayShapeMatcher - trailling groups are not optional when PREG_UNMATCHED_AS_NULL (#3219), #11311, thanks @staabm!
- Fix preg_match named capturing groups (#3228), #11323, thanks @staabm!
- RegexArrayShapeMatcher - Fix optional groups with PREG_UNMATCHED_AS_NULL (#3229), thanks @staabm!
- Allow overriding the PHP 7.2 support for PREG_UNMATCHED_AS_NULL (#3226), thanks @Seldaek!
- RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with optional leading groups (#3234), #11331, thanks @staabm!
- RegexArrayShapeMatcher - Support preg_quote()'d patterns (#3233), #11332, thanks @staabm!
- RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with top level alternation (#3238), thanks @staabm!
- RegexArrayShapeMatcher - More precise non-empty-string and numeric-string (#3249), thanks @staabm!
- Fix regex parsing by completing the grammar (#3244), thanks @Seldaek!
- RegexArrayShapeMatcher -
(\d*)
can be empty-string (#3257), thanks @staabm!
- Add
diagnose
command to run DiagnoseExtensions (https://github.com/phpstan/phpstan-src/commit/22c84d2e64dd30780c995d8a720a487bb484dc02) - Diagnose extension: Info about extensions installed via extension-installer (https://github.com/phpstan/phpstan-src/commit/db71f04aa14f5be6421e92d7b76031605de5ad80)
- Diagnose extension - where is PHPStan running from (https://github.com/phpstan/phpstan-src/commit/76464eed45dee10154cb25b9f05586c346046adc)
- Parallel scheduler becomes DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/c7c9689cd86a9811eeaa2bb365ab5bc302109802)
- ResultCacheManager: output restore time in debug mode (#3224), thanks @janedbal!
- Add hint as to what might be wrong when invalid identifiers are used (#3230), thanks @Seldaek!
- Optimize array_map with many arrays (https://github.com/phpstan/phpstan-src/commit/09fbc92c415a2b9789463b3ca8fa7c73cc3475bd), #11297
- Improved
sprintf()
inference (#3232), thanks @staabm! - Print elapsed analysis time with
-v
(#3239, #3242), thanks @janedbal! - More precise
sprintf()
format arg-based return type (#3192), #11248, #10493, thanks @staabm!
Bugfixes 🐛
- Fix return type of round/ceil/floor in non strict type environment (#3223), #11319, thanks @BackEndTea!
- Fix statement analysis after early-terminating statements (#3227), #11179, thanks @takaram!
- Fix match of union of enums (https://github.com/phpstan/phpstan-src/commit/44e40f054569f3eeed81280bf0d2f50659fb1056), #11313
- Fix
pathinfo()
return type for union type flags (#3120), #10760, thanks @staabm! - Fix and simplify discovering composer autoloader project path (https://github.com/phpstan/phpstan-src/commit/2cc6cda6969a63267e70c2074efa0477b69c9083)
- Ignore non-explicit NeverType in purity check (#3243), #11207, thanks @staabm!
- Non-numeric strings in
pow()
lead to error (#2796), #10125, thanks @staabm! - Closure with by-ref parameter is impure (https://github.com/phpstan/phpstan-src/commit/f1abacddb3787ce279e51b1f88f1543d52b9759c), #11361
- PathRoutingParser - check if the file is a symlink that might be in analysed paths (https://github.com/phpstan/phpstan-src/commit/c9a6d2e61edfad189a765df3c3a06674a10d4fb5), #6585
Function signature fixes 🤖
Internals 🔍
- Indicate file on TypeInferenceTestCase validation errors (#3166), thanks @staabm!
- nette/di - patch for PHP 8.4 support (https://github.com/phpstan/phpstan-src/commit/1245ea73e5a24aefc4fac87ebe73d9720deac7c9)
- InternalError is part of
@api
(#3240), thanks @janedbal! - Refactor RegexArrayShapeMatcher (#3248), thanks @staabm!
- Refactor PrintfParametersRule (#3247), thanks @staabm!
- Simplify RegularExpressionPatternRule (#3251), thanks @staabm!
- Copy regex grammar from hoa/regex into the project (https://github.com/phpstan/phpstan-src/commit/bacb3c6d11edb5f30176e70ade6e72ac4f2e23dd)
- Apply Grammar.patch to reflect previous phpstan state (https://github.com/phpstan/phpstan-src/commit/e71cff468aa4695e9bfa09d01e0ec5194890e7f1)
- ExecutionEndNode always has a statement (https://github.com/phpstan/phpstan-src/commit/27e0f91efad4c9fcacae98b2e3394c069e9e5095)
- Fix PHP_VERSION_ID comparison in test (#3254), thanks @staabm!
- Apply the stricter signatures for PHP 8.0 after the basic ones for PHP 8.0 (#3259), thanks @thg2k!
- Refactor function signature map files loading (#3262), thanks @thg2k!
v1.11.7
Improvements 🔧
- Rework
match
expression analysis with enum with performance in mind (https://github.com/phpstan/phpstan-src/commit/b98abe01ca2a589c964970ea42128ae9b752890b), #11263 - DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/d55933fa0c8d6c9d91c5d30f70313e1c15b2c7f9)
- This extension can output any diagnostic information to stderr after analysis
- PHPStan displays this information when running the "analyse" command with
-vvv
CLI option.
- Result cache - debug message about successfully restored cache (https://github.com/phpstan/phpstan-src/commit/979055fceeaefec30c1eded52550012f0c1333b6)
- Show a hint about
-vv
for unignorable errors when generating the baseline (https://github.com/phpstan/phpstan-src/commit/d931c8987563fbe5a05e411722a6f53da6f1b555), #3973 - Limit the depth when resolving closure type for performance reasons (https://github.com/phpstan/phpstan-src/commit/2c08dfa8d0f975654d52fe279a950c54415076b5?w=1), #11283
-
MutatingScope::resolveType()
- cache closure body analysis data (https://github.com/phpstan/phpstan-src/commit/fd3115652b76278fa6ddf8ba40b41fc751642153), #11283
Bugfixes 🐛
- Observe
@no-named-arguments
above class (https://github.com/phpstan/phpstan-src/commit/815270d8933b9cdefa4613f0baf17bcbff91be6f), #11275 - Fix
count()
narrowing on $matches (#3210), #11277, thanks @staabm! - Try preventing "Method was not found in reflection of class" when getting a method prototype (https://github.com/phpstan/phpstan-src/commit/25658f64f0bcfe784893104864d92032cce33e96), #11269, #11251
- RegexArrayShapeMatcher - support resetting non-capturing groups (#3212), #11291, thanks @staabm!
- Prevent out-of-memory errors while regex array shape inference (#3213), #11292, thanks @staabm!
Function signature fixes 🤖
-
getimagesize
,getimagesizefromstring
: zero is a possible value for height and width (#3207), thanks @mfruehauf!
Internals 🔍
- Faster
ObjectType::getEnumCases()
(#3203, #3204), #11263, thanks @staabm! - Update composer-dependency-analyser to 1.6.0 (#3205), thanks @janedbal!
v1.11.6
Bleeding edge 🔪
- Precise array shapes for
preg_match()
for$matches
by-ref parameter (#2589), thanks @staabm! - Improved the type of the
$mode
parameter for thecount()
(#3190), thanks @kuma3!
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 🔧
- PHPStan Pro - report fatal errors more nicely (https://github.com/phpstan/phpstan-src/commit/a99c71e3bed8f393fad26faaab5def7a5bfa0c03)
- PHPStan Pro - do not repeat ProcessCrashedException in CLI output because it's already presented in the UI (https://github.com/phpstan/phpstan-src/commit/6e700418d6609c51154d672a197e43bd74fa761f)
- Add Cloudflare CA to composer/ca-bundle cacert.pem (https://github.com/phpstan/phpstan-src/commit/30f68ba7555e88ad9bdb326a1bed735d79fb29ea)
- Implement ParameterOutTypeExtensions (#3083), thanks @staabm!
- Do not output some internal errors twice (https://github.com/phpstan/phpstan-src/commit/4f75ba6bdc856ed6db4ba2862b610394cdbfbf15, https://github.com/phpstan/phpstan-src/commit/9967f48574a045af8305ebbcc585f6951e013a36)
- Forbid _HumbugBox prefixed classes (#3186), thanks @staabm!
Bugfixes 🐛
- Fix return type of sprintf with single
%s
format (#3167), #11201, thanks @pilif! - Add PCRE_VERSION predefined constant (#3169), #11202, thanks @curry684!
- Cast non-zero IntegerRangeType toString() is a non-falsy-string (#3170), thanks @staabm!
- More precise
UnitEnum::cases()
return type (https://github.com/phpstan/phpstan-src/commit/32f351a24ce103f120f413cd104bc411608df109), #11244, #11233 - Reset remembered match cond when entering match (https://github.com/phpstan/phpstan-src/commit/07995276abd80b766407534055f58592ffe1a1a5), #11246, #9879, thanks @jdecool!
Function signature fixes 🤖
- Fix type of return value for
WeakMap::offsetGet()
(#3165), #11194, thanks @sonnymilton! - Treat SplFileObject methods as impure/having side effects (#3174), #11200, thanks @mind-bending-forks!
- More precise
getimagesize*
return type (#3183), thanks @staabm!
Internals 🔍
- Prevent unnecesary calls to
Type::isSuperTypeOf()
(#3164), #11194, thanks @staabm! - Update phpcs config with proper exclude pattern (#3150), thanks @thg2k!
- Use bashunit for e2e tests (#3160), #11202, thanks @staabm!
- issue-bot: subshell is eating the exit code (#3171), thanks @staabm!
- Fix typo in FunctionDefinitionCheck (#3176), thanks @szepeviktor!
- Add spelling workflow (#3179), thanks @szepeviktor!
- Refactor SprintfFunctionDynamicReturnTypeExtension (#3187), thanks @staabm!
- Simplify SprintfFunctionDynamicReturnTypeExtension (#3188), thanks @staabm!
- Added regression test (#3198), thanks @staabm!
- Use early-returns in TypeCombinator (#3197), thanks @staabm!
v1.11.5
Bleeding edge 🔪
- Check array functions which require stringish values (#3132), #11141, #5848, #3694, #11111, thanks @schlndh!
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 🔧
- When internal errors occur, do not show other reported errors (https://github.com/phpstan/phpstan-src/commit/aa921137be5b510408bc8df9b8b6fe632ed09db5)
- It's important to first solve internal errors before seeing other reported errors
- Inspired by https://github.com/phpstan/phpstan/discussions/11107 (ReviewDog was eating up important errors)
- Show internal errors nicely in PHPStan Pro
Bugfixes 🐛
- Fix bug in
get_debug_type()
DynamicFunctionReturnTypeExtension (#3128), thanks @patrickkusebauch! - Include path when counting errors ignored by identifier (#3154), #11177, thanks @pilif!
- Implement bit shift operation on integers and unions (#3145), thanks @thg2k!
- Fix division type result with even integer range (#3152), thanks @thg2k!
- Solve identical comparison bug in call-site variance (#3153), #11161, #10697, thanks @VincentLanglet!
Function signature fixes 🤖
-
gnupg_init()
options
parameter is optional (#3129), thanks @yphoenix! - Update outdated
RedisCluster::__construct
signature (#3130), #11158, thanks @wolfgangzwiauer! - Improve image related functions signature (#3127), thanks @thg2k!
- Update/fix ext-amqp signatures (#3139), thanks @ben-challis!
- fix
AMQPQueue::unbind()
routingKey type (#3143), thanks @ben-challis! - Add parameter definitions to
AMQPQueue::consume()
callback (#3144), #9445, thanks @ben-challis! - Add int ranges to AMQP typings (#3146), thanks @ben-challis!
- Various fixes to the return signature of
IntlDateFormatter
methods (#3149), thanks @chosten! - Fix
Exception::getTrace()
return type (https://github.com/phpstan/phpstan-src/commit/492cd89932d873147cdf7acf49c88d432cbce69f) - fix posix_getpwuid (#3157), thanks @pistej!
Internals 🔍
- Regression test (#3136), thanks @staabm!
- Relax test version restriction (#3140), thanks @thg2k!
- Fix
PrepareCommand::fixComposerJson()
(https://github.com/phpstan/phpstan-src/commit/4537ef1445b910930afa32d7fd8f22b044fdc726) - Internal errors as structured objects (https://github.com/phpstan/phpstan-src/commit/7cd03f02a5c32ca4e51006dc21d6184f73835a14)
- WorkerCommand - do not return exit code 1 in case of internal errors, they are handled anyway (https://github.com/phpstan/phpstan-src/commit/f76d836d13fb94e9887260ae18229ad2ca2ce2ce)
- NodeScopeResolverTest - remove requires (https://github.com/phpstan/phpstan-src/commit/f6b989881e66445197f6526bfcde868a60472098)
- Fix discrepancy between
lint >=
andPHP_VERSION_ID
in NodeScopeResolverTest (https://github.com/phpstan/phpstan-src/commit/b530b0d53d3fc990dcb0225e0d997af06ee15180) -
TypeInferenceTestCase::gatherAssertTypesFromDirectory()
(https://github.com/phpstan/phpstan-src/commit/595de78d35124d00eed90c09f5fd73cb40351e02) - Take advantage of gatherAssertTypesFromDirectory in NodeScopeResolverTest (#3159)
- Turn TraitsCachingIssueIntegrationTest into a e2e test (#3151), thanks @staabm!
v1.11.4
Improvements 🔧
- Detect
--generate-baseline
combined with--pro
(https://github.com/phpstan/phpstan-src/commit/dd028cb4ccc44c6aa12b51f443e8761d5d4efc1d), #11093 - Add error identifier to RawErrorFormatter (#3112), #11125, thanks @zonuexe!
- Pass current rule level to PHPStan Pro (https://github.com/phpstan/phpstan-src/commit/7af14fbfc027b15e3342ac95be783bd3fa1df413)
- Read and enforce PHPStan version constraints from
phpstan/extension-installer
v1.4 (https://github.com/phpstan/phpstan-src/commit/1d005ef1e72f77afada37bad491f2b6602f4cc92)
Bugfixes 🐛
- Consider
numeric-string
types after string concat (#3117), thanks @staabm! - Fix type loss with recursive
count()
(#2812), thanks @staabm! -
array_slice()
returnsnon-empty-array
for existing offsets and positive limit (#3124), #10721, thanks @staabm! - Consider a
ClosureType()
as maybe impure by default when no$impurePoints
array provided (#3125), #11135, thanks @jf-m!
Function signature fixes 🤖
- Make the return type of
tempnam()
andtmpfile()
to benevolent union (#3111), thanks @zonuexe! - Fix
gnupg_init
function (#3118), thanks @pistej!
Internals 🔍
- Update
react/promise
(https://github.com/phpstan/phpstan-src/commit/da754e2294a619bacc95cd42426e94c17a57365b)
v1.11.3
Improvements 🔧
- Add new
*ParameterClosureTypeExtension
(#3089), thanks @canvural! - DynamicFunctionReturnTypeExtension for the
get_debug_type
function (#2910), #10558, #10585, thanks @patrickkusebauch! - Infer more duplicated array keys (#3058), #6976, thanks @VincentLanglet!
- Improve
explode
return type precision (#3096), thanks @staabm! - Make assigning property via reference impure (#3082), thanks @schlndh!
- Support new PHP 8.4 mb_lcfirst, mb_ucfirst function variants (#3095), thanks @staabm!
Bugfixes 🐛
- Make
array_map
argument take into account unpack (#2901), #10527, thanks @ryium! - Fixes incorrect types reported by
parse_url
(#2918), #4754, thanks @ChrisBrenton! - Ensure
$http_response_header
is alist<string>
(#2959), thanks @Seldaek! - Keep numeric-strings in
str_repeat()
(#2914), #10572, thanks @staabm! - Array is non-empty even when
in_array
is not strict (#2539), #9662, #10228, thanks @staabm! - Fix
substr()
type narrowing for possibly single char result (#3081), #11035, #9804, thanks @staabm! - Fix escaping of the error message in various output formatters (#3087), thanks @mousetail!
-
$this
cannot be reassigned when passed by reference (#3097), #10477, thanks @takaram! - Subtract zero-float when comparing against zero-int (#3102), #5309, thanks @staabm!
- Fix fatal error on
constant('')
(#3013), #10867, thanks @staabm!
Function signature fixes 🤖
- Add new header functions for PHP 8.4 (#3093), thanks @Seldaek!
- Fix wrong return type for
SplFileObject::fgets()
(#3103), thanks @DanielSiepmann! - Update
Locale
signatures (#2880), #7855, #8149, thanks @devnix! - Fix wrong
fread()
length parameter type and return type (#3105), thanks @thg2k! - ReflectionFunction and ReflectionMethod::getClosure cannot return null (https://github.com/phpstan/phpstan-src/commit/dae9335075964f197aa5d965b3d38c12788a6405), #10839
- Make method names
non-falsy-string
(#3108), thanks @schlndh!
Internals 🔍
- Add regression test (#3066), #3300, thanks @herndlm!
- Update phpdoc-parser (#3107)
-
TemplateTagValueNode::$name
cannot be empty string (https://github.com/phpstan/phpdoc-parser/commit/fcaefacf2d5c417e928405b71b400d4ce10daaf4), thanks @staabm!
-
- Fix property descriptions in ReflectionProviderGoldenTest (#3109), thanks @schlndh!
v1.11.2
Improvements 🔧
- Stricter
@phpstan-ignore
identifiers parser (#3079, #3090, #3091), thanks @janedbal!- The parser now rejects some syntax that was possible but undocumented in 1.11.0 and 1.11.1
- The parser now allows to attach comment to each single identifier in a list:
@phpstan-ignore identifier (comment), identifier2 (comment2)
- Resolving type of closure - get
$passedToType
frominFunctionCallsStack
(https://github.com/phpstan/phpstan-src/commit/ca41b7d8c2d54407156d07dab5375a3a5ebbeb29, https://github.com/phpstan/phpstan-src/commit/da4fd7a4122615d9dbae55083bdfd290026fa08e), #5508, #10254, #10732 - Do not lose generic type when the closure has native return type (https://github.com/phpstan/phpstan-src/commit/7e9cd45701562fb02f1aa9cab1f89b58a58f6526), #9086
Function signature fixes 🤖
Internals 🔍
- Fix Composer by referencing deleted tag of
nette/di
(https://github.com/phpstan/phpstan-src/commit/2ab647e12fe46d970fa630b78f9ca962354b3d16) - Specify
array_filter
callbacks (https://github.com/phpstan/phpstan-src/commit/754b7b8e170cd36ed7bc8633b90651eff16cc893) - Add
@api
annotation toAcceptsResult::__construct
(#3092), thanks @canvural!
v1.11.1
Improvements 🔧
Bugfixes 🐛
- Do not complain about
impure(Function|Method).pure
if it has@phpstan-assert
tags (https://github.com/phpstan/phpstan-src/commit/9544f8a6b52dbd6068800bbfc5bdaf67fe04a8c2) - Remove tip about deprecated config option (https://github.com/phpstan/phpstan-src/commit/d603c7b676e3b91f4b7ba81d46aee3e9a593f883), #11000
- Fix false positive with
reportPossiblyNonexistentConstantArrayOffset: true
(https://github.com/phpstan/phpstan-src/commit/5277630459518024b16272bf6b6fd216eb3d10ed), #10997 - Fix parent keyword case sensitivity (#3064), thanks @staabm!
- InlineHTML is an impure point (#3072), thanks @staabm!
- UnionTypeHelper - prevent infinite recursion (https://github.com/phpstan/phpstan-src/commit/bb3da26d562727c3122a344622059ded2239d6ab), #11027
- Fix more potential for infinite recursion (https://github.com/phpstan/phpstan-src/commit/1d02c4f27684644e8361cf2a2bc5713adef9b95e)
- RangeFunctionReturnTypeExtension - fix internal ValueError (https://github.com/phpstan/phpstan-src/commit/fe3895ada98940d1a71c2eb115d61afda9fd7a2c), #11026
- Property unset is an impure point (https://github.com/phpstan/phpstan-src/commit/702ddcd7805ba08c0765bdf0930beaef0e6b4fc1), #11001
- Fix property assign not being an impure point in arrow function (https://github.com/phpstan/phpstan-src/commit/35ff6895f48b74e8bc0dda7ec94c40e73c84099b), #11001
- Fix internal error when accessing enum case by class-string (https://github.com/phpstan/phpstan-src/commit/1116e03389f0f47297c2638b5b67c84f4d339478), #10985
- Fix resolving
self
andstatic
in@phpstan-closure-this
from trait stub file (https://github.com/phpstan/phpstan-src/commit/93402494ee92dd2e7264f112105151586203e0ec), #11009 - CallToMethodStatementWithoutImpurePointsRule - fix for methods called on unions (https://github.com/phpstan/phpstan-src/commit/ee33f1e48b5ae9d6e99500814c186cd31e7a764f), #11011
Function signature fixes 🤖
- Offset
uri
instream_get_meta_data
calls is always present on PHP 8.3+ (https://github.com/phpstan/phpstan-src/commit/885d46bc8d7555a8b762914821ad2f0f5871e517), #11024, #10999
v1.11.0
Read the article about PHPStan 1.11 on phpstan.org »
Major new features 🚀
-
Error identifiers
- A way to categorize reported errors by a stable identifier. Up until now you had to use specific and ever-changing error messages
- Can be used for ignoring specific errors locally with new
@phpstan-ignore
comment (uses current or next line automatically) - Can be used for ignoring specific errors in
ignoreErrors
section of your configuration file (phpstan.neon) - Can be used in output formatters
- Can be seen in PHPStan Pro GUI or in TableErrorFormatter with
-v
- Catalogue with source code links: https://phpstan.org/error-identifiers
-
PHPStan Pro Reboot
- A new migration wizard will effortlessly migrate all your
@phpstan-ignore-line
and@phpstan-ignore-next-line
to the new@phpstan-ignore
comment style with error identifiers. The old comment style is dangerous because it ignores all errors, current and future, on that line. - Revamped UI for much more comfortable viewing and browsing of reported errors
- The new UI also lets you browse ignored errors, from
ignoreErrors
, from your baseline and also ignored locally in source code using comments - Streaming errors during launch: You don't have to wait for the analysis to complete, you can see errors as they come in during the analysis
- Support for mapping file paths to the host filesystem when running in Docker or remotely
- Try it out by running PHPStan with
--pro
CLI option
- A new migration wizard will effortlessly migrate all your
- PHPDoc tags describing callable lifecycle:
@param-immediately-invoked-callable
,@param-later-invoked-callable
- Useful for exception analysis (https://phpstan.org/blog/bring-your-exceptions-under-control) and
@phpstan-pure
- Useful for exception analysis (https://phpstan.org/blog/bring-your-exceptions-under-control) and
- PHPDoc tag
@param-closure-this
to describe what$this
is bound to in a passed closure - Two new config options around stricter offset checks in arrays (#3028), #7553, thanks @ttomdewit!
reportPossiblyNonexistentGeneralArrayOffset
reportPossiblyNonexistentConstantArrayOffset
- Learn more in the documentation
Bleeding edge 🔪
- Checking truthiness of
@phpstan-pure
above functions and methods - Check
new
/function call/method call/static method call on a separate line without any side effects even without@phpstan-pure
PHPDoc tag on the declaration side - BetterNoopRule - take advantage of impure points (https://github.com/phpstan/phpstan-src/commit/a6470521b65d7424f552633c1f3827704c6262c3), #10389
- Run missing type check on
@param-out
(https://github.com/phpstan/phpstan-src/commit/56b20024386d983927c64dfa895ff026bed2798c) - CallToConstructorStatementWithoutSideEffectsRule - report class with no constructor (https://github.com/phpstan/phpstan-src/commit/b116d25a6e4ba6c09f59af6569d9e6f6fd20aff4)
- Deprecated: returning plain strings as errors, use RuleErrorBuilder
- Deprecated: returning RuleError without identifier (https://github.com/phpstan/phpstan-src/commit/969e6fa31d5484d42dab902703cfc6820a983cfd)
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 🔧
- Generic RuleErrorBuilder (https://github.com/phpstan/phpstan-src/commit/9a3ed85178097e2d74f27623dd02bdd72c571e5b)
- Deprecate
checkMissingIterableValueType: false
andcheckGenericClassInNonGenericObjectType: false
in favour of ignoring via identifiers (https://github.com/phpstan/phpstan-src/commit/a64998108b318581b0203e84582711c3e4d1e43c) - Deprecate old NoopRule - replaced by BetterNoopRule in bleeding edge (https://github.com/phpstan/phpstan-src/commit/109083571de6102cb854b9975c1463551ef678d0)
- Allow ignoring errors from CollectedDataNode with local comments (https://github.com/phpstan/phpstan-src/commit/dc3b75ab4a2acd863405416620240302b284973a)
- Introduce
new
type (#3050), #9704, thanks @ruudk! - RuleTestCase - fail on PHP warnings, notices etc. (#3030), thanks @janedbal!
- Check duplicate assignment of redeclared promoted readonly properties (#3049), #8101, #9863, #9864, thanks @schlndh!
- Remove line from "nikic/php-parser" error message (#2845), thanks @mvorisek!
- Stub validator - PHPStan classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/d004c239677fb7abe41aa16e8e1b45bfac63f773)
- Stub validator - PhpParser classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/3e498e1592221f3a01527c10318424014d52f85d)
- CheckstyleErrorFormatter - include error identifier in source attribute (https://github.com/phpstan/phpstan-src/commit/f66cf5badd2c98317d1d296ba24c3be77efcda18), #1205
- BaselinePhpErrorFormatter - error identifiers in comments (https://github.com/phpstan/phpstan-src/commit/4b32cac2d1b98c6af65c07041fdbc64e5d3f3baf)
-
RuleErrorBuilder::file()
- file path needs to exist (https://github.com/phpstan/phpstan-src/commit/c453f29f60992167a5aa46d4926c18a420ae7b26) - AbstractMethodInNonAbstractClassRule - better error message for enums (https://github.com/phpstan/phpstan-src/commit/b5dd34e492b03566458e98b314c6852cfd683916)
- Fixed Xdebug spelling (#2746), thanks @derickr!
- Track invalidated
$this
and used variables after invoking closure (#2980) - Support
@phan-
prefixes on recognized PHPDoc tags (#3000), thanks @anomiex! -
pure-callable
andpure-Closure
PHPDoc types (https://github.com/phpstan/phpstan-src/commit/cdaff5f00d621c3a94e048b8bd9fa864d47b3228) -
highlight_string()
flips side-effects depending on $return (#3021), thanks @staabm! - Improve types for predefined constants (#3054), thanks @zonuexe!
Bugfixes 🐛
- Make
AccessoryNonFalsyStringType::toInteger()
returnIntegerType
instead of non-zero (#3018), #10893, thanks @zonuexe! - Filter scope by non-empty array after foreach regardless of
polluteScopeWithAlwaysIterableForeach
(#3029), #10922, thanks @VincentLanglet! - Preserve large arrays with same keys through union (#3032), #9397, #10080, thanks @schlndh!
- Fix
count($x) > $n === true
negation (#3037), #10952, thanks @rvanvelzen! - Fix NAN not accepting NAN (#3036), #10956, #10297, thanks @rvanvelzen!
- DateTimeInstantiationRule - fix error message for
new
with wrong name case (https://github.com/phpstan/phpstan-src/commit/59ac31a554203a7ae3fb9449bbd5b61f3afe2e20) - Process ConstFetch (https://github.com/phpstan/phpstan-src/commit/b5c63c296783bd067b14bad410dab2b87a1b7b3c)
- Fix
preg_match_all
behaviour with no flags (https://github.com/phpstan/phpstan-src/commit/a856ec7ab5540cb4a8d30e9e170958a32a7165b2) -
file_get_contents
is an impure function (https://github.com/phpstan/phpstan-src/commit/2b5b3174c7f00e56b7692b4c26552b2ad13c73d5) - Fix
ClosureType::equals()
(https://github.com/phpstan/phpstan-src/commit/29c35b584a948e9a3c90e2d56312069ce073e6e6) - Use statement result of analysed anonymous class to inform about throw points and impure points (https://github.com/phpstan/phpstan-src/commit/70a75f68896e5f7eaa988c0cb7f20dad32c3c172)
- Filter out implicit throw points from callables when
exceptions.implicitThrows: false
(#3016), thanks @janedbal! - Fix
ConstantArrayType::hasOffsetValueType()
for offset union type where all types are valid (https://github.com/phpstan/phpstan-src/commit/26e949b0d093751c98e9a106f680092abf3b28d9) -
non-empty-list
always has offset 0 (https://github.com/phpstan/phpstan-src/commit/f4d1d481472b45c56ba2cd49ae98065092217f36) - Narrow to
non-empty-string
/non-falsey-string
aftermb_strlen()
(#3038), thanks @staabm! - Implement
Type::isOffsetAccessLegal()
to detect offset access that crashes even inisset()
(#3045), #8393, #10926, thanks @rajyan! - Specify types on
match()
condition correctly (#3053), #10974, #9694, thanks @rvanvelzen! -
json_decode
with force array flag: subtract all objects, not just stdClass (#3052), thanks @rajyan! - Fix
strlen($x) > $n === true
negation (#3040), thanks @staabm! - Support multi-byte string function variants (#3039), thanks @staabm!
- Final scope from
Continue_
points should not be used forwhile (true)
(#3057), #10980, thanks @greew! - Fix enum performance problem (#3062, #3060), #10979, thanks @staabm!
- NULL and null as a property default value are treated differently when overriding a parent property (#3063), #10987, thanks @staabm!
Function signature fixes 🤖
- Make the url key of metadata returned by
stream_get_meta_data()
optional (#3024), #10887, thanks @hirokinoue! - Narrow
Closure::bind
$newScope
param (#2817), thanks @mvorisek! - Infer object type mysqli_fetch_object (#2675) (#2675), thanks @staabm!
- Fix
Imagick::identifyImage()
return type (#3017), thanks @SVillette!
Internals 🔍
- Clean up old identifiers and metadata (https://github.com/phpstan/phpstan-src/commit/c476a8611d06ed5ce850ba74bd087ed0fa9304ad)
- Delete StatementOrderVisitor that is no longer needed (https://github.com/phpstan/phpstan-src/commit/017d321f47b2a49c11b0337a920235b0770da164)
- Introduce
ClassReflection::getClassTypeDescription()
(https://github.com/phpstan/phpstan-src/commit/dec9e435a7e0cea96079eb08c799df6b49b92e82) - Fix classname typo in tests (#2461), thanks @szepeviktor!
- Fix various typos (#2463), thanks @szepeviktor!
- Added text regarding patch issues during installation (#2670), thanks @mt-satak!
- Fix typo in ArgumentsNormalizer (#2705), thanks @mad-briller!
- Rich PHPDoc for ExceptionTypeResolver (https://github.com/phpstan/phpstan-src/commit/e7ab4f741c0ec22cf70457c7a542b7978202b10a)
- Hide internal commands (#2833), thanks @rvanvelzen!
- Test invalidated object in static closure (#2981), thanks @staabm!
- PHPDoc: address multiple variables defined in one @param (#3001), thanks @Muqsit!
- Do not assume every contributor uses PhpStorm (https://github.com/phpstan/phpstan-src/commit/d1834e69d06e0f85a45db8f5fb7a2c5a6ce898b6)
- TypeInferenceTestCase: ability to disable implicit throws (#3015), thanks @janedbal!
- Slightly reduce comparing and calling methods for trivial optimizations (#3004), #10926, thanks @zonuexe!
- AnalyserResultFinalizer - DRY of running CollectedDataNode rules (https://github.com/phpstan/phpstan-src/commit/38e2c96ee45733c8d3b44d048ce27a9b5450718e)
- Introduce LocalIgnoresProcessor (https://github.com/phpstan/phpstan-src/commit/d026655260727c7c6e4cd69d50d57569e9128c13)
- Introduce
RuleErrorBuilder::treatPhpDocTypesAsCertainTip()
for a bit more DRYness (#3035), thanks @axlon! - Make ResultCacheEndToEndTest pass level 9 (#3055), #10977, thanks @AJenbo!
- ClassReflection - cache enum cases (https://github.com/phpstan/phpstan-src/commit/39ce0425737cdbacfee5fbc08160d023cb5bc639), #10979
v1.10.67
This is the last release, or one of the last releases, in 1.10.x series. The next one is going to be PHPStan 1.11, and it's going to be released at some point in May 2024.
Improvements 🔧
- Forbid PHPUnitPHAR prefixed classes (#3002), thanks @staabm!
- Improve error messages on unnamed parameters (#3010), #10814, thanks @takaram!
Bugfixes 🐛
- Improve
date()
return types (#2888), #10468, #6613, thanks @zonuexe! - Default value null does not make promoted property type nullable (https://github.com/phpstan/phpstan-src/commit/b2177e350f79176a5d53eaf75e37e5dce0053f8a), #9839
- Fix socket_select array types after call (https://github.com/phpstan/phpstan-src/commit/24c52494be982429eb6782ad859fb6cbd6fb3dee), https://github.com/phpstan/phpstan/discussions/10285
- Fix conditional types in PHPDocs from stubs for native functions (https://github.com/phpstan/phpstan-src/commit/8ae0b28a5c1e6f4e2c692caff0cd99df07f2486e)
- Fix env int key problem (https://github.com/phpstan/phpstan-src/commit/e606fbedaea7e887456a771ce0dbb9572d16accf), #10833
- Fix false positives about uninitialized properties (#2897), #10523, #10822, thanks @staabm!
- Incremented numeric-string should change to int/float (#2797), #10122, #10187, thanks @staabm!
- Do not generalize big array when combined with empty array (#3003), #10834, thanks @RobertMe!
- Fix string concatenation with benevolent union type (https://github.com/phpstan/phpstan-src/commit/4a4c739f9ff85b6c73659c21f8f3b8b7af8c82c9), #10863
- Treat
get_defined_vars()
as using constructor arguments (#3012), #10865, thanks @rvanvelzen! - Allow undefined variables passed into by-ref parameters only if the type is nullable (https://github.com/phpstan/phpstan-src/commit/7f8f9cce7f3903e505916c7afe04b7912570b5e2, https://github.com/phpstan/phpstan-src/commit/7961f7ae1fe815b0796e4d73717f1b117d4a7163), #1916
Function signature fixes 🤖
- More precise
gc_status()
signature for PHP8.3+ (#2996), thanks @staabm! - Add object shape for
mysqli_result::fetch_fields
(#3005), thanks @schlndh!
Internals 🔍
- composer-dependency-analyser: update to 1.5.0 (support functions) (#3011), thanks @janedbal!
phpstan/phpstan-symfony (phpstan/phpstan-symfony)
v1.4.9
- 51ab243 - Require PHPStan 1.12
- 30d0886 - Pin build-cs
- 4279753 - Test newer PHP versions
- 3cf113f - Fix stubs
v1.4.8
- 14eec8c - Add stub for AbstractController::createForm()
v1.4.7
- ee88a01 - Fix internal error when DIC param map has > 256 items
v1.4.6
- e909a07 - DiagnoseExtension
v1.4.5
- 1bd7c33 - Also support command argument and initialize method
v1.4.4
- bca27f1 - Fix interact method inference
v1.4.3
- af6ae0f - Update getArgument return type in interact method
v1.4.2
- 2c3d666 - Support for alias to inlined service
v1.4.1
- d530cfe - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- f4b9407 - Synchronize stub with symfony
- 3fbf634 - Synchronize stub with symfony
- 99848d8 - Add stub for Compound::getConstraints()
v1.4.0
- 51183fe - Update lock-closed-issues.yml
- f4b9407 - Synchronize stub with symfony
- 3fbf634 - Synchronize stub with symfony
- 99848d8 - Add stub for Compound::getConstraints()
- 8148308 - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- c9f5ceb - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- 67e208d - Add documentation to load DI helper
- a0e0f1f - chore(deps): update metcalfc/changelog-generator action to v4.3.1
- b2ddd0f - chore(deps): update cbrgm/mastodon-github-action action to v2
- 3b3083d - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- 4cc4788 - chore(deps): update metcalfc/changelog-generator action to v4.2.0
- 44b68dd - chore(deps): update dessant/lock-threads action to v5
- 5586faa - Merge branch '1.3.x' into 1.4.x
- b9e1ded - Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- ce3c258 - Error identifiers
- 6a0cefe - Require PHPStan 1.11
- 67cf72e - Open 1.4.x-dev
v1.3.12
- f4b9407 - Synchronize stub with symfony
v1.3.11
- 3fbf634 - Synchronize stub with symfony
v1.3.10
- 99848d8 - Add stub for Compound::getConstraints()
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This MR will be recreated if closed unmerged. Get config help if that's undesired.
- [ ] If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.