Releases: phpstan/phpstan
Releases · phpstan/phpstan
1.10.38
Improvements 🔧
Bugfixes 🐛
- Update BetterReflection
- Fix for non-backed enums (ondrejmirtes/BetterReflection@4dd0f2b)
- Do not invalidate types passed by value (phpstan/phpstan-src@0b8dca7), #9927
- Do not influence types of arguments before the function is called (phpstan/phpstan-src@c45d42d)
- Fixed collapsing of constant arrays (phpstan/phpstan-src@746de74), #9985
Internals 🔍
- Lazier type-resolving in
isset
checks (#2664), thanks @staabm! - Refactor to invalidate args inside
processArgs
(phpstan/phpstan-src@52eb6f8) - Merge array types a bit later (phpstan/phpstan-src@adbc35a)
1.10.37
Bugfixes 🐛
- Support array shape covariance when the optional key is missing in the subtype (#2655), #9905, #5655, #7273, thanks @staabm!
- Fix conditional types (#2659), #9951, #9963, thanks @rvanvelzen!
- Handle exception thrown from callable object's
__invoke
method (#2502), #6233, thanks @VincentLanglet! - Update BetterReflection
- ReflectionSourceStubber - fix enum as default function parameter value (ondrejmirtes/BetterReflection@135a394), larastan/larastan#1749
1.10.36
Improvements 🔧
- DumpParametersCommand:
--json
option (phpstan/phpstan-src@91a0002) - Implement
reportUncheckedExceptionDeadCatch
option (defaults totrue
) (#2648), #9921, thanks @VincentLanglet! - Support union types in
array_chunk()
(#2635), thanks @staabm! - Result cache: Indicate key differences in cache metadata (#2630), thanks @staabm!
- Get rid of annoying "on an unknown class ReflectionEnum" error on PHP < 8.0 (phpstan/phpstan-src@2b9af36)
Bugfixes 🐛
- Fix resolving nested conditional types with union subjects (#2641), #9860, thanks @rvanvelzen!
- Detect array_rand second parameter (#2633), #9803, thanks @staabm!
- Fix subtracting types from union template types (#2652), #9939, thanks @rvanvelzen!
- fix infinite cycle due to incorrect implements/extends (#2483), thanks @schlndh!
- Fix ConstantFloatType value dump precision (#2358), thanks @mvorisek!
- Do not trigger PhpDocInheritanceResolver if we do not need the PHPDoc type when resolving the type of ClassConstFetch (#2414), #9039, thanks @VincentLanglet!
Function signature fixes 🤖
connection_*
functions are impure (#2555), thanks @staabm!- Add stubs for
mysqli
andmysqli_result
classes (#2295), thanks @phansys!
Internals 🔍
1.10.35
Major new features 🚀
- Generics: Type projections aka call-site variance (#2485), thanks @jiripudil!
Bugfixes 🐛
- Make
value-of<...>
lazier (phpstan/phpstan-src@234f77d), #9881 - Update BetterReflection, #9877
- Fix
ReflectionAttribute::newInstance()
with nested class using named arguments (ondrejmirtes/BetterReflection@8d751dd), thanks @enumag!
- Fix
- Improve typing of filters that do not accept non-falsy strings (#2620), thanks @zonuexe!
Internals 🔍
- name-collision-detector 2.0 (phpstan/phpstan-src@c3cb573)
- Remove
phpstan/phpstan-php-parser
(#2632), thanks @staabm!
1.10.34
Improvements 🔧
- Add support and tests for
$this
type assertions (#2609), #8904, thanks @ekisu! - Update phpstan/phpdoc-parser to 1.24.0
- Allow asserting the type of
$this
(phpstan/phpdoc-parser#209), thanks @ekisu! - Avoid creating an Exception when it is not necessary (phpstan/phpdoc-parser#208), thanks @mad-briller!
- Allow asserting the type of
- Added
--fail-without-result-cache
CLI option (#2611), thanks @staabm! - Make result cache independent from configs include order (#2606), thanks @staabm!
- Reduce unnecessary calls into reflection (#2614), thanks @staabm!
- Micro-optimize with
in_array()
(#2618), thanks @zonuexe! - Cover ArgumentsNormalizer with BC promise (phpstan/phpstan-src@b87db62)
- LastConditionVisitor: condition followed by throw is marked as last (#2405), thanks @JanTvrdik!
Function signature fixes 🤖
- fix incorrect doc for
inotify_read
(#2605), thanks @taka-oyama!
Internals 🔍
- name-collision-detector (phpstan/phpstan-src@95cdbe5)
1.10.33
Improvements 🔧
- Support for referencing environment variables in the config (#2559), #1918
- Made parent class reflection resolving lazier (#2584), thanks @staabm!
- FileTypeMapper - optimization of type aliases (phpstan/phpstan-src@2be81ac)
- Use NonAcceptingNeverType in more places (phpstan/phpstan-src@3e03e9d)
- MethodCall: mark virtual nullsafe call with attribute (#2598), #9830, thanks @janedbal!
Bugfixes 🐛
- Fix
checkBenevolentUnionTypes: true
along with@template
witharray-key
bound (#2587), #9766, thanks @VincentLanglet! - Fix type inference of
array_sum()
(#2591), #9808, thanks @zer0-star! - Update Symfony polyfills (phpstan/phpstan-src@dfcaa30), #8538
Function signature fixes 🤖
Internals 🔍
1.10.32
Improvements 🔧
- Optimize FileTypeMapper for huge PHPDocs (#2582), #9498
- This fixes performance issue for projects that use Carbon (
nesbot/carbon
)
- This fixes performance issue for projects that use Carbon (
- Optimize DumpParametersCommand (phpstan/phpstan-src@379008a)
1.10.31
Improvements 🔧
- Cache OptimizedDirectorySourceLocator data for faster subsequent runs and less work needed by child processes (phpstan/phpstan-src@b66210f)
NonAcceptingNeverType
(#2540), #9133, #6485, thanks @jiripudil!- ClearResultCacheCommand -
--xdebug
option (phpstan/phpstan-src@3befb53)
Internals 🔍
- Do not pass a fake path to analyse in ClearResultCacheCommand; check paths count later when asking for files (phpstan/phpstan-src@4e37a2d)
- FileCacheStorage - reference cache key in a comment (phpstan/phpstan-src@0fbf0ee)
1.10.30
Improvements 🔧
- NotAnalysedTraitRule - do not report for analysis of files-only paths (phpstan/phpstan-src@5f59d58)
Bugfixes 🐛
- Fix several issues with nullsafe type specification (#2577), #9105, #5172, #8517, #7980, #8664, #9293, thanks @schlndh!
- Do not report unused class elements if the element is used on an uncertain type like
mixed
(phpstan/phpstan-src@cbdb30d), #9765 - ConditionalTagsExtension: add missing tags (#2574), thanks @janedbal!
- CleaningVisitor - keep closures and arrow functions (phpstan/phpstan-src@0501aaf), #9776
- Fix baseline for access to uninitialized property from trait (#2568), thanks @schlndh!
- Fix generalizing types in loops (phpstan/phpstan-src@c09be9e), #9753
- Fix foreach scope when iterating non-array and
polluteScopeWithAlwaysIterableForeach
istrue
(phpstan/phpstan-src@853a1e6), #9784
Internals 🔍
- Issue bot - special NotAnalysedTraitRule that runs even with
onlyFiles=true
(phpstan/phpstan-src@6c941ae) - Ability to disable
implicitThrows
in tests (#2576), thanks @janedbal! - Rename duplicate symbols (phpstan/phpstan-src@2171717)
1.10.29
Improvements 🔧
- Update nikic/php-parser to v4.17.1
- PHP 8.3 features are no longer parse errors. Full-fledged PHP 8.3 support is coming later this year.
- Update BetterReflection to 6.12.0
Bugfixes 🐛
- PHPStan Pro - when launching,
PHP_BINARY
needs to be escaped (phpstan/phpstan-src@2c7cfd8)