1.12.6
Bleeding edge 🔪
- Added absent type checks about
@phpstan-assert
PHPDoc tags (phpstan/phpstan-src@ca0a7e9), #11780
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 nikic/php-parser to v4.19.4 (phpstan/phpstan-src@0b9ce98)
- Process
ClassConstFetch::$class
when it's a Name node (phpstan/phpstan-src@712c33e) - Process
ClassConstFetch::$name
(phpstan/phpstan-src@b38c852) - Fix unused private property is not sometimes detected (#3539), #11802, thanks @staabm!
Bugfixes 🐛
- Fixes for
lowercase-string
- Keep lowercase when trim (#3491), thanks @VincentLanglet!
- Add support for str_repeat and str_pad for lowercase string (#3490), thanks @VincentLanglet!
- Update ReplaceFunctionsDynamicReturnTypeExtension for lowercase-string (#3489), thanks @VincentLanglet!
- Update parse_str for lowercase string (#3492), thanks @VincentLanglet!
- More precise
IntegerRangeType::toString()
(#3475), thanks @staabm! - Add support for lowercase-string on parse_url() (#3493), thanks @VincentLanglet!
- Improve Vsprintf inference (#3496, #3501), thanks @VincentLanglet!
- Offset access on lowercase-string is lowercase-string (#3502), thanks @staabm!
- IntegerType::toString() is lowercase (#3510), thanks @VincentLanglet!
- Handle lowercase string in sprintf (#3498), thanks @VincentLanglet!
- Update composer/pcre (phpstan/phpstan-src@3cdac94), #11786
- Fix a few regex class parsing usecases (#3488), thanks @mvorisek!
- Fix preg_match_all with PREG_SET_ORDER does not see capture group as optional (#3506), #11661, thanks @staabm!
- Fix false-positive with preg_match(): Strict comparison using === between '' and non-falsy-string…ween '' and non-falsy-string (#3509), #11744, thanks @staabm!
Function signature fixes 🤖
- functionMap: a bit more precise get_defined_constants (#3537), thanks @janedbal!
- token_name() returns non-empty-string (#3540), thanks @staabm!
- curl_multi_getcontent() can return null (#3527), thanks @staabm!
- Update SplFileInfo::getPathInfo return type (#3487), thanks @DannyvdSluijs!
- Update return type of
spl_autoload_functions
on PHP8.0+ (#2810), thanks @ManuelHu!
Internals 🔍
- Fix missing ltrim in regex parse (#3495), thanks @mvorisek!
- Un-deprecate ConstantTypeHelper (phpstan/phpstan-src@3a83f6b)
- Introduce
Scope::getMaybeDefinedVariables()
(#3521), #11772, thanks @ruudk! - TypeInferenceTestCase: allow asserting array offset certainty (#3503), thanks @ruudk!
- Simplify preserveKeys TrinaryLogic creation in two extensions (#3516), thanks @herndlm!
- Add
Type::sliceArray()
(#3514) (#3514), thanks @herndlm! - Set normalized in BenevolentUnionType (#3522), thanks @herndlm!
- Refactor RegexGroupParser for more immutability and less pass-by-ref (#3508), thanks @staabm!