1.10.20
版本发布时间: 2023-06-20 20:14:47
phpstan/phpstan最新发布版本:1.12.6(2024-10-06 23:06:59)
Improvements 🔧
- PHPStan Pro: Change Cloudflare DNS for to family version (#2467), thanks @spaze!
- Add
non-zero-int
type (#2449), thanks @PrinsFrank! - Implement
gettype()
return type extension (#2437), thanks @staabm!
Bugfixes 🐛
- Allow to remember constant and impure expressions in
match
condition (https://github.com/phpstan/phpstan-src/commit/0cdda0b210a623ee299323da80771c2c84c602f9), #4451, #6064, #9457 - Fix
gettype
inmatch
condition (https://github.com/phpstan/phpstan-src/commit/e4ef00c0573daea5e83199d182e35ea988a7d95b, https://github.com/phpstan/phpstan-src/commit/caa0a5b5247b2ff58c56b543aa3cb286b00ffde7), #8614 - Fix
get_class
inmatch
condition (https://github.com/phpstan/phpstan-src/commit/106526db8bd64880af81faa61d9f970e793e3c38), #1885, #8536, #8092 - Understand
get_class
compared withstatic::class
(https://github.com/phpstan/phpstan-src/commit/590eb03e0ce2b5b02562ee9bb0af803fcbb1dc95), #1885 - Understand
gettype
when there's a union of strings on the other side (https://github.com/phpstan/phpstan-src/commit/36e412ffed0ab6f4220c58276b06041a7a487db3), #6294, #2580 - Treat ConstantArrayType as covariant in its keys and values (#2464), #9161, thanks @jiripudil!
- Treat ArrayType as covariant in its keys and values (#2465), thanks @jiripudil!
- Make
NonEmptyArrayType::toArray()
return$this
(#2349), #9208, thanks @zonuexe! - Retain list type via
array_push()
andarray_unshift()
(#2451), #8449, thanks @herndlm! - For
@var
above throw and return, change the type of expr only for the stmt callback (https://github.com/phpstan/phpstan-src/commit/b55109537dd62ac0e352b0a55df62cfc83f12f08), #9459
Internals 🔍
- Remove redundant conditions from RemoveUnusedCodeByPhpVersionIdVisitor. (#2459), thanks @mad-briller!
- Return early in CachingVistor to avoid always-false instanceof checks. (#2460), thanks @mad-briller!
- Introduce CombinationsHelper (https://github.com/phpstan/phpstan-src/commit/175307e12de100632a05f6a122e0873a3c1fc6a1)
-
Type::getFiniteTypes()
(https://github.com/phpstan/phpstan-src/commit/7912caf4b66bdff65d3d6795d4c584c17ece5e51, https://github.com/phpstan/phpstan-src/commit/fa9a951f808466be36792ba65f128f9838ab617e, https://github.com/phpstan/phpstan-src/commit/b5cf52b916ad4d155f1809356c96cbe924f51dbe)
1、 phpstan.phar 20.82MB
2、 phpstan.phar.asc 833B