Releases: phpstan/phpstan
Releases · phpstan/phpstan
1.10.40
Improvements 🔧
- TemplateTypeCheck tries to resolve template type names such as
self
because they're not usable (phpstan/phpstan-src@c6fad64), #10049
Bugfixes 🐛
- Fix used memory reporting (#2686), thanks @staabm!
- Fix switch statement with enum in the condition (#2687), #9806, thanks @schlndh!
- Fix null coalesce assignment type (#2702), #9995, thanks @hirokinoue!
- Fix
!==
with union of constants (#2700), #10002, thanks @schlndh! - Process statements inside
declare(ticks=...)
(phpstan/phpstan-src@eb39381), #10059 - Fix crash when template types map and variances map are not of equal length (phpstan/phpstan-src@1308c52), #10049
Function signature fixes 🤖
- functionMap.php fixes for YAF 3.3.5 (#2696), thanks @mbakirov!
- Remove
\
from DateTimeZone in functionMap (#2693), thanks @simPod! - Allow
Redis::pconnect
to have 7 parameters (#2695), thanks @Vaalyn!
Internals 🔍
1.10.39
Improvements 🔧
- More information about thrown exception in child process (phpstan/phpstan-src@d6a576a)
- PHPStan Pro - allow overriding
pro.tmpDir
config parameter (phpstan/phpstan-src@4a95206, phpstan/phpstan-src@7c4ef6b) - Optimize memory consumption when doing sha1 file hash (#2680), thanks @staabm!
- Optimize memory consumption in ResultCacheManager (#2681), thanks @staabm!
Bugfixes 🐛
- Filter right side of
??=
with=== null
(phpstan/phpstan-src@f407ac6) - Fix possible internal error when analysing code with enums on PHP 7.x (phpstan/phpstan-src@b9d9626), #9974
- NonexistentOffsetInArrayDimFetchRule - do not report errors on expressions after truthy
isset
check (phpstan/phpstan-src@6fbd6e4), #9991 - Use real native function name instead of lowercase one (#2673), #10003, thanks @fredden!
- Include property intializations from parent scope for anonymous functions (#2607), #9831, thanks @fabacino!
- FileFinder - make list of found files unique (phpstan/phpstan-src@7491260)
- Fix internal error with first-class callable in
array_filter
(phpstan/phpstan-src@0228643), #9994 - Fix subclass acceptability when class alias is involved on "ours" side (phpstan/phpstan-src@d5c599c), #10023
Function signature fixes 🤖
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)