0.12.97
Improvements 🔧
- Support for
literal-string
PHPDoc type inspired byis_literal()
RFC (https://wiki.php.net/rfc/is_literal), #5507 - Support
bool
as template type bound (phpstan/phpstan-src@9d191f9) - Support
float
as template type bound (phpstan/phpstan-src@4e7d6c1), #5331 - Make
ReflectionAttribute
generic (#640, #643), thanks @vhenzl! - Implemented math on IntegerRangeType and ConstantIntegerType (#637), #4843, thanks @staabm!
- Support
non-empty-array
type in[] != $arr
conditions (#649), thanks @staabm! - Optimization - do not sort huge unions (phpstan/phpstan-src@5a44c29), #5500
- Optimize calculating scalar values from huge unions (phpstan/phpstan-src@a6ca5f7), #5527
- Update PHP 8 stubs (phpstan/phpstan-src@a82605f)
Bugfixes 🐛
- Reflection: fixed context of invoking a trait method (phpstan/phpstan-src@89ceb6a), #5497
- Union normalization - do not take template types apart (phpstan/phpstan-src@3b17c0e)
self::CONSTANT
can be precise even with PHPDoc type (phpstan/phpstan-src@5010ef4), #5517- Fix CallableType's string type assumptions (phpstan/phpstan-src@9a9f193)
- OptimizedDirectorySourceLocator - fixed crash when parsing
Text.php
ofnl_BE
from Faker (phpstan/phpstan-src@a09a98d), #5525 - Fix
?parent
in return type (phpstan/phpstan-src@30c9b01), #5529 - Fixed missing return rule for native mixed type (phpstan/phpstan-src@03d8312)
- Make mixin method static if there's
__callStatic()
in the class (phpstan/phpstan-src@114a38f), #5536 - added
sizeof()
as alias ofcount()
for Smaller/SmallerOrEqual (#647, #648), #4843, thanks @staabm! - Refactor PreInc and PreDec (phpstan/phpstan-src@a6a23dc), #1870
- Fix inferring
TemplateUnionType
((phpstan/phpstan-src@1b5710a), #5562
Function signature fixes 🤖
- substr_count returns non-negative integer (phpstan/phpstan-src@8db058a), #5513
- mb_str_split() / str_split() always returns
non-empty-array
(#633), thanks @staabm! - Third parameter of
sodium_base642bin()
is optional. (#644), thanks @tehbeard! - Make
filter_var()
returnnon-empty-string
if input is non-empty (#642), thanks @devbanana! - use positive-int in
iterator_count()
/iterator_apply()
(#646), thanks @staabm! - use positive-int in
array_count_values()
(#645), thanks @staabm! filter_var()
should return non empty string only when it will not be sanitized (#650), thanks @devbanana!- Sync
parse_url
signature with PHP 8 (phpstan/phpstan-src@f7c6464)