Releases: phpstan/phpstan
Releases · phpstan/phpstan
1.10.11
Bleeding edge 🔪
- Fix position variance of static method parameters (#2313), thanks @jiripudil!
- Check variance of template types in properties (#2314), thanks @jiripudil!
- OverridingMethodRule - include template types in prototype declaring class description (phpstan/phpstan-src@ca2c66c)
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 🔧
- Helper PHPDoc type:
template-type
(callingType::getTemplateType()
method) (phpstan/phpstan-src@b6d0c87), #9053 - Some useful advanced PHPDoc types (phpstan/phpstan-src@387ebd5)
enum-string
empty-scalar
non-empty-scalar
non-empty-literal-string
pure-callable
closed-resource
non-empty-mixed
callable-array
- RuleErrorBuilder - support multiple tips nicely (phpstan/phpstan-src@e06c529)
- StrictComparisonOfDifferentTypesRule - tip for always true comparison between enums (phpstan/phpstan-src@a327965, phpstan/phpstan-src@9850ea7)
- Handle invalid type aliases better (phpstan/phpstan-src@fc5515a), #9077, #8473
- Uses phpstan/phpdoc-parser 1.17
- phpstan/phpdoc-parser@bfec872
- phpstan/phpdoc-parser@d3753fc
Bugfixes 🐛
- Be smarter about new array keys after assignment (phpstan/phpstan-src@6c32371), #9131, #8900, #8222
- Fix
StaticType::isSuperTypeOf()
for subtypes ofObjectType
(phpstan/phpstan-src@b439fed), #9142 TypehintHelper::decideTypeFromReflection()
should accept correct ancestor's ClassReflection, not just class name (phpstan/phpstan-src@297a9fe)
Function signature fixes 🤖
1.10.10
Improvements 🔧
- JsonErrorFormatter - include identifiers (phpstan/phpstan-src@6910be2)
- AccessPropertiesRule - tip with article link (phpstan/phpstan-src@e6e2d1a)
- Note about
--xdebug
when Xdebug is enabled (phpstan/phpstan-src@1d4ede1)
Bugfixes 🐛
- IssetCheck - respect
treatPhpDocTypesAsCertain
for variables (phpstan/phpstan-src@5b7a115), #9126 - IssetCheck - respect
treatPhpDocTypesAsCertain
in more places (phpstan/phpstan-src@49d2aa6) - Do not check template type variance in constructor (#2311), thanks @jiripudil!
Function signature fixes 🤖
1.10.9
Improvements 🔧
- Test cases - make some methods static because of PHPUnit 10 dataProviders (phpstan/phpstan-src@ea2670a), #9070
- StrictComparisonOfDifferentTypesRule - tip about
treatPhpDocTypesAsCertain
(phpstan/phpstan-src@40400ae) - ConstantLooseComparisonRule - respect
treatPhpDocTypesAsCertain
(phpstan/phpstan-src@72472dd) - ConstantLooseComparisonRule - tip about
treatPhpDocTypesAsCertain
(phpstan/phpstan-src@d892c34) - PHPStan Pro - configurable DNS servers (phpstan/phpstan-src@f3711a2), #9106
- Attempt unloading Xdebug before showing warnings (#2299), thanks @AJenbo!
Function signature fixes 🤖
- Fix
pg_pconnect
function signature (#2300), thanks @dravnic! - Fix incorrect type for
NumberFormatter::parseCurrency
(#2309), thanks @rovansteen!
1.10.8
Improvements 🔧
- Detect large
.php
baseline file in analysed paths and warn about possible PHPStan slowdown (phpstan/phpstan-src@d6d9ef7)
Bugfixes 🐛
- Don't report unknown class in inline
@var
afterclass_exists()
(#2292), #9055, thanks @staabm! - Improve
Ds\Map::get()
@throws
inference (#2297), #9066, thanks @simPod! - Support of unofficial specifiers in
sprintf
/printf
(#2301), #9072, #2342, thanks @kukulich!
Internals 🔍
- Rich PHPDocs for extension interfaces (phpstan/phpstan-src@23d29ab, phpstan/phpstan-src@f67a372, phpstan/phpstan-src@cbfb23d)
- Browse at: https://apiref.phpstan.org/
1.10.7
Improvements 🔧
- Backed enums - dynamic return type extension for
from()
andtryFrom()
(phpstan/phpstan-src@edcaaba)
Function signature fixes 🤖
- Fix
XMLReader::XML
return type (phpstan/phpstan-src@195cb7b)
Internals 🔍
- Compiled PHAR - commit and sign as @phpstan-bot (phpstan/phpstan-src@e73523d)
1.10.6
Bleeding edge 🔪
- Report narrowing
PHPStan\Type\Type
interface via@var
(phpstan/phpstan-src@713b98f), larastan/larastan#1567 (comment) - Check invalid PHPDocs in previously unchecked statement types (phpstan/phpstan-src@9780d35)
- InvalidPHPStanDocTagRule in StubValidator (phpstan/phpstan-src@9c2552b)
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 🔧
- InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (phpstan/phpstan-src@d943d58)
Bugfixes 🐛
1.10.5
Improvements 🔧
- Check local type aliases above traits (phpstan/phpstan-src@4654c16)
Bugfixes 🐛
- Fix type aliases in method-level template types (phpstan/phpstan-src@c926144), #9008
- Fix type aliases in traits (phpstan/phpstan-src@60021c2), #5091
- Fix interface accepting a Closure (phpstan/phpstan-src@0dbe3ab), #9006
- Process enum case expression (phpstan/phpstan-src@f64b27c), #9005
- Fixed missing processing of UseUse and GroupUse (phpstan/phpstan-src@b797512)
1.10.4
Improvements 🔧
- Remove 3 leading spaces in PHAR (#2254), #8952, thanks @ruudk!
- Add missing newline at the end of the file (#2254), thanks @ruudk!
- RuleError interfaces are part of BC promise (phpstan/phpstan-src@aed9319)
- Update nikic/php-parser (phpstan/phpstan-src@dda95b4)
- Update BetterReflection (#2274), #8889
Bugfixes 🐛
- Fix bug with
array_column
(#2244), #8917, thanks @VincentLanglet! - Improve
filter_var()
handling of a couple of simple scalars and null (#2262), thanks @herndlm! - Fix
value-of
for multiple enums (phpstan/phpstan-src@3adc91d), #8983 - Fix
->value
on unions of enums (phpstan/phpstan-src@05b85ba), #9000
Function signature fixes 🤖
- Fix return type of
Ds\Sequence::copy()
(#1954), thanks @MidnightDesign! - Fix
password_hash()
return type (#2260), #5978, thanks @VincentLanglet!
1.10.3
Improvements 🔧
Bugfixes 🐛
- Fix arithmetic operations with BenevolentUnionType (phpstan/phpstan-src@f882eff), #8938
- Fix native return type of
array_chunk()
(phpstan/phpstan-src@e4a6d20), #8956 - Support for property fetch in initializers (phpstan/phpstan-src@53c643d), #8957
- ObjectType - fix enum property with subtracted type (phpstan/phpstan-src@eb00fd2), #8828, #8486
1.10.2
Improvements 🔧
- Allow generating baseline in .php format (phpstan/phpstan-src@8260032), #8870
- See documentation: https://phpstan.org/user-guide/baseline#php-baseline-format-instead-of-neon