Releases: phpstan/phpstan
1.10.59
Bleeding edge 🔪
array_values
rule (report when alist
type is always passed in) (#2917), thanks @kamil-zacek!
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 🔧
- ArrayFilterRule - tip message about
treatPhpDocTypesAsCertain
(phpstan/phpstan-src@f5b198c) - ArgumentsNormalizer - skip unused arguments in non-variadic signatures, still return a normalized call (phpstan/phpstan-src@17e5bac)
- Methods in fluent interfaces are considered impure (phpstan/phpstan-src@b026126)
- Add type-specifying extension for
settype()
(#2920), thanks @ChrisBrenton!
Bugfixes 🐛
- MethodAssertRule - do not report implicitly inherited assert tags (phpstan/phpstan-src@299df51), #10573
- Gets rid of the annoying error "Asserted type ... with type ... does not narrow down the type."
- ConstantArrayType - string offset might exist as integer offset (phpstan/phpstan-src@2fb6632), #10577
Internals 🔍
- Parallelize levels tests (#2916), thanks @staabm!
FunctionReflection::isPure()
andExtendedMethodReflection::isPure()
(phpstan/phpstan-src@03d01ea)
1.10.58
Improvements 🔧
- Verify property type after
unset
(phpstan/phpstan-src@aeadbe2), #10506, #6773
Bugfixes 🐛
- InvalidThrowsPhpDocValueRule: support
@phpstan-require-extends
(#2890), #10475, thanks @RobertMe! sort()
,rsort()
andusort()
convert an array to list (#2891), #6467, #10423, #3312, thanks @takaram!- Fix stale result cache with imported type aliases (#2894), #10449, thanks @staabm!
- Avoid internal error with
T<X>
whereT
bound consist of intersection type (phpstan/phpstan-src@778b569), #10509 - Recognize
[1 => 'method', 0 => $obj]
as callable (#2896), #10502, thanks @staabm! - SprintfFunctionDynamicReturnTypeExtension - limit combinatorial explosion (phpstan/phpstan-src@51cffd4), #10538
- Fix implicit
@phpstan-assert
PHPDoc inheritance with generics (#2909), #10037, #9123, thanks @RobertMe!
Internals 🔍
1.10.57
Bleeding edge 🔪
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 🔧
- Update
ClassReflection::getConstant()
return type (phpstan/phpstan-src@8d4ea60) - Cover
ClassConstantReflection
with BC promise (phpstan/phpstan-src@8f82b79)
Bugfixes 🐛
- Preserve TemplateTypeArray when merging array types (phpstan/phpstan-src@8342785), #10445
- Fix
array_filter
callback return type (phpstan/phpstan-src@59ae706) - Fix undefined XMLReader properties with local phpstorm-stubs patch (phpstan/phpstan-src@2d364d7), #8629
- Fix spaceship operator for large constant unions (#2886), thanks @schlndh!
- MissingClassConstantTypehintRule should not apply to native types (phpstan/phpstan-src@6363932)
- Do not generalize class-level
@template
type in method call (phpstan/phpstan-src@11268e5), #10473
Function signature fixes 🤖
1.10.56
Major new feature 🚀
- New PHPDoc tags:
@phpstan-require-extends
,@phpstan-require-implements
, #10302, #9899, #8550, thanks @staabm!- Learn more: Making
@property
PHPDoc above interfaces work on PHP 8.2+ - Enforcing class inheritance for interfaces and traits
- Enforcing implementing an interface for traits
- Development of this feature was kindly sponsored by Pixel & Tonic, the team behind Craft CMS
- Learn more: Making
Improvements 🔧
- Scope - function call stack includes parameters too (phpstan/phpstan-src@b87e5c4), phpstan/phpstan-deprecation-rules#107
Bugfixes 🐛
- Process
match
arm condition before analysing the body (phpstan/phpstan-src@2b74aa8), #10418
Function signature fixes 🤖
- Fix transliterator function maps (#2862), thanks @PrinsFrank!
- Fix duplicate array key
Yaf_Response_Http::__clone
(#2863), thanks @PrinsFrank! - Add array shape for
transliterator::listIDs
return type (#2865), thanks @PrinsFrank! strtok()
always returns anon-empty-string
when it does not return false (#2869), thanks @staabm!
Internals 🔍
- Prevent repetative calls to
Type::getConstantArrays()
(#2864), thanks @staabm! - Remove redundant condition in ParametersAcceptorSelector (#2867), thanks @mad-briller!
- Simplify default return path in extensions (#2868), thanks @staabm!
- Reduce unnecessary calls to
Scope::getFunctionType()
(#2872), thanks @staabm!
1.10.55
Improvements 🔧
- PHPDoc tag
@phpstan-ignore-next-line
works for first line below the PHPDoc even in bleeding edge (phpstan/phpstan-src@8b6260c), #10383, #10374 - Add
open-resource
type (phpstan/phpstan-src@bbd9a68), #10399 - Optimize repeated container creation in tests (#2860), thanks @schlndh!
- Try to prevent error with PHP-Parser 5 when running PHPUnit tests (phpstan/phpstan-src@9dac90d), #10401, thanks @zonuexe!
Bugfixes 🐛
- Fix mixing property and param attributes on promoted property (#2825), #10385
- Fix detection of shadowed trait methods (phpstan/phpstan-src@2270051), #10377
- Fix int-range return type for range() (#2792), #10213, #9573, thanks @dantleech!
Internals 🔍
- Remove unused DirectClassReflectionExtensionRegistryProvider (#2857), thanks @staabm!
- Plumbing for
@phpstan-require-extends
and@phpstan-require-implements
(#2856), thanks @staabm! Scope::getFunctionCallStack()
(phpstan/phpstan-src@9be1376), phpstan/phpstan-deprecation-rules#106
1.10.54
Bleeding edge 🔪
- Revert "ParamAttributesRule - promoted property attribute needs to target both parameters and properties" (phpstan/phpstan-src@02f66df), #10385
- See PHP internals discussion: https://externals.io/message/111942#112021
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 🔧
Bugfixes 🐛
- Simplify TooWideClosureReturnTypehintRule (phpstan/phpstan-src@a81df66)
- Fix falsy isset for all expressions (phpstan/phpstan-src@af14d50), #10373
1.10.53
Improvements 🔧
Bugfixes 🐛
- Fix loading polyfills twice (3e7c7c7?w=1), #10387
array_udiff()
comparator return type is too strict (#2822), #9697, thanks @staabm!
Internals 🔍
1.10.52
Improvements 🔧
- Do not allow to generate baseline when reflection error occurs (phpstan/phpstan-src@78ea9a6)
- Show internal errors that occured when generating a baseline (phpstan/phpstan-src@c997ea9)
Bugfixes 🐛
1.10.51
Bleeding edge 🔪
- ParamAttributesRule - promoted property attribute needs to target both parameters and properties (phpstan/phpstan-src@25d1552), #10298
- More precise
RecursiveIteratorIterator::__construct()
parameter types (#2835), thanks @staabm! - PhpDocParser: add config for lines in its AST & enable ignoring errors within PHPDocs (#2807), thanks @janedbal!
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 🔧
- Missing ThrowExprTypeRule - level 3 (phpstan/phpstan-src@0359ebc)
- Analyse stubs only when not only files are analysed (phpstan/phpstan-src@4020240)
- Nicer error message in case of memory limit exhaustion in child process (phpstan/phpstan-src@816be99)
Bugfixes 🐛
- Narrow
ReflectionEnum::getBackingType()
afterReflectionEnum::isBacked()
(#2830), #10167, thanks @staabm! - Fix coalescing on an optional array offset (#2834), #10317, thanks @rvanvelzen!
- More precise
??
type inference (phpstan/phpstan-src@d801919), #10327
Internals 🔍
- phpstan-src is now downgraded for PHP 7.2+ with
ondrejmirtes/simple-downgrader
- Forward-compatible changes with PHP-Parser 5 (phpstan/phpstan-src@436bd79, phpstan/phpstan-src@7eb66f6, phpstan/phpstan-src@bf0b138), #5086
- Use
str_starts_with()
andstr_contains()
instead ofstrpos()
(#2841), thanks @zonuexe! - Building preload script - sort by name for reproducible builds (phpstan/phpstan-src@995de26)
- Lazier creation of ParameterAcceptor (#2843), thanks @staabm!
- Use const instead of properties (#2815), thanks @zonuexe!
- PhpDocValueRule: cheapest check first (#2824), thanks @staabm!
- Faster
ParametersAcceptorSelector::combine()
(#2851), thanks @staabm!
1.10.50
Improvements 🔧
- Update
nikic/php-parser
to 4.18.0 (phpstan/phpstan-src@24f92cc)
Bugfixes 🐛
VoidType
- acceptnull
(phpstan/phpstan-src@40c8fb2), #10291
Internals 🔍
InvalidPromotedPropertiesRule
- useFunctionLike
as node type (#2823), thanks @paulbalandan!- Deduplicate inferred template type generalization logic (phpstan/phpstan-src@39fe102)