phpstan/phpstan
### [`v1.10.21`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.21)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.20...1.10.21)
# Bugfixes 🐛
- Fix defining variables in match condition (https://github.com/phpstan/phpstan-src/commit/d6c2752b4edf145120d7b0ac7908828fde2289e8), [#9474](https://togithub.com/phpstan/phpstan/issues/9474)
- Fix UnusedClosureUsesRule for already traversed match (https://github.com/phpstan/phpstan-src/commit/a7194865487069a0c718227e5a39cd6eab32b8ea), [https://github.com/phpstan/phpstan-phpunit/issues/190](https://togithub.com/phpstan/phpstan-phpunit/issues/190), [#9478](https://togithub.com/phpstan/phpstan/issues/9478)
- Update BetterReflection (https://github.com/phpstan/phpstan-src/commit/a540e44a3649f722464488db3b786c5c894c1775), [#9477](https://togithub.com/phpstan/phpstan/issues/9477)
- Fix newInstance on ReflectionAttribute adapter with enum argument (https://github.com/ondrejmirtes/BetterReflection/commit/277b96077b3c15c12605d876be1b87dd1a88b6f8)
# Internals 🔍
- Cheap checks first in ObjectType ([#2475](https://togithub.com/phpstan/phpstan-src/pull/2475)), thanks [@mad-briller](https://togithub.com/mad-briller)!
### [`v1.10.20`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.20)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.19...1.10.20)
# Improvements 🔧
- PHPStan Pro: Change Cloudflare DNS for to family version ([#2467](https://togithub.com/phpstan/phpstan-src/pull/2467)), thanks [@spaze](https://togithub.com/spaze)!
- Add `non-zero-int` type ([#2449](https://togithub.com/phpstan/phpstan-src/pull/2449)), thanks [@PrinsFrank](https://togithub.com/PrinsFrank)!
- Implement `gettype()` return type extension ([#2437](https://togithub.com/phpstan/phpstan-src/pull/2437)), thanks [@staabm](https://togithub.com/staabm)!
# Bugfixes 🐛
- Allow to remember constant and impure expressions in `match` condition (https://github.com/phpstan/phpstan-src/commit/0cdda0b210a623ee299323da80771c2c84c602f9), [#4451](https://togithub.com/phpstan/phpstan/issues/4451), [#6064](https://togithub.com/phpstan/phpstan/issues/6064), [#9457](https://togithub.com/phpstan/phpstan/issues/9457)
- Fix `gettype` in `match` condition (https://github.com/phpstan/phpstan-src/commit/e4ef00c0573daea5e83199d182e35ea988a7d95b, https://github.com/phpstan/phpstan-src/commit/caa0a5b5247b2ff58c56b543aa3cb286b00ffde7), [#8614](https://togithub.com/phpstan/phpstan/issues/8614)
- Fix `get_class` in `match` condition (https://github.com/phpstan/phpstan-src/commit/106526db8bd64880af81faa61d9f970e793e3c38), [#1885](https://togithub.com/phpstan/phpstan/issues/1885), [#8536](https://togithub.com/phpstan/phpstan/issues/8536), [#8092](https://togithub.com/phpstan/phpstan/issues/8092)
- Understand `get_class` compared with `static::class` (https://github.com/phpstan/phpstan-src/commit/590eb03e0ce2b5b02562ee9bb0af803fcbb1dc95), [#1885](https://togithub.com/phpstan/phpstan/issues/1885)
- Understand `gettype` when there's a union of strings on the other side (https://github.com/phpstan/phpstan-src/commit/36e412ffed0ab6f4220c58276b06041a7a487db3), [#6294](https://togithub.com/phpstan/phpstan/issues/6294), [#2580](https://togithub.com/phpstan/phpstan/issues/2580)
- Treat ConstantArrayType as covariant in its keys and values ([#2464](https://togithub.com/phpstan/phpstan-src/pull/2464)), [#9161](https://togithub.com/phpstan/phpstan/issues/9161), thanks [@jiripudil](https://togithub.com/jiripudil)!
- Treat ArrayType as covariant in its keys and values ([#2465](https://togithub.com/phpstan/phpstan-src/pull/2465)), thanks [@jiripudil](https://togithub.com/jiripudil)!
- Make `NonEmptyArrayType::toArray()` return `$this` ([#2349](https://togithub.com/phpstan/phpstan-src/pull/2349)), [#9208](https://togithub.com/phpstan/phpstan/issues/9208), thanks [@zonuexe](https://togithub.com/zonuexe)!
- Retain list type via `array_push()` and `array_unshift()` ([#2451](https://togithub.com/phpstan/phpstan-src/pull/2451)), [#8449](https://togithub.com/phpstan/phpstan/issues/8449), thanks [@herndlm](https://togithub.com/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](https://togithub.com/phpstan/phpstan/issues/9459)
# Internals 🔍
- Remove redundant conditions from RemoveUnusedCodeByPhpVersionIdVisitor. ([#2459](https://togithub.com/phpstan/phpstan-src/pull/2459)), thanks [@mad-briller](https://togithub.com/mad-briller)!
- Return early in CachingVistor to avoid always-false instanceof checks. ([#2460](https://togithub.com/phpstan/phpstan-src/pull/2460)), thanks [@mad-briller](https://togithub.com/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)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
1.10.19
->1.10.21
Release Notes
phpstan/phpstan
### [`v1.10.21`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.21) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.20...1.10.21) # Bugfixes 🐛 - Fix defining variables in match condition (https://github.com/phpstan/phpstan-src/commit/d6c2752b4edf145120d7b0ac7908828fde2289e8), [#9474](https://togithub.com/phpstan/phpstan/issues/9474) - Fix UnusedClosureUsesRule for already traversed match (https://github.com/phpstan/phpstan-src/commit/a7194865487069a0c718227e5a39cd6eab32b8ea), [https://github.com/phpstan/phpstan-phpunit/issues/190](https://togithub.com/phpstan/phpstan-phpunit/issues/190), [#9478](https://togithub.com/phpstan/phpstan/issues/9478) - Update BetterReflection (https://github.com/phpstan/phpstan-src/commit/a540e44a3649f722464488db3b786c5c894c1775), [#9477](https://togithub.com/phpstan/phpstan/issues/9477) - Fix newInstance on ReflectionAttribute adapter with enum argument (https://github.com/ondrejmirtes/BetterReflection/commit/277b96077b3c15c12605d876be1b87dd1a88b6f8) # Internals 🔍 - Cheap checks first in ObjectType ([#2475](https://togithub.com/phpstan/phpstan-src/pull/2475)), thanks [@mad-briller](https://togithub.com/mad-briller)! ### [`v1.10.20`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.20) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.19...1.10.20) # Improvements 🔧 - PHPStan Pro: Change Cloudflare DNS for to family version ([#2467](https://togithub.com/phpstan/phpstan-src/pull/2467)), thanks [@spaze](https://togithub.com/spaze)! - Add `non-zero-int` type ([#2449](https://togithub.com/phpstan/phpstan-src/pull/2449)), thanks [@PrinsFrank](https://togithub.com/PrinsFrank)! - Implement `gettype()` return type extension ([#2437](https://togithub.com/phpstan/phpstan-src/pull/2437)), thanks [@staabm](https://togithub.com/staabm)! # Bugfixes 🐛 - Allow to remember constant and impure expressions in `match` condition (https://github.com/phpstan/phpstan-src/commit/0cdda0b210a623ee299323da80771c2c84c602f9), [#4451](https://togithub.com/phpstan/phpstan/issues/4451), [#6064](https://togithub.com/phpstan/phpstan/issues/6064), [#9457](https://togithub.com/phpstan/phpstan/issues/9457) - Fix `gettype` in `match` condition (https://github.com/phpstan/phpstan-src/commit/e4ef00c0573daea5e83199d182e35ea988a7d95b, https://github.com/phpstan/phpstan-src/commit/caa0a5b5247b2ff58c56b543aa3cb286b00ffde7), [#8614](https://togithub.com/phpstan/phpstan/issues/8614) - Fix `get_class` in `match` condition (https://github.com/phpstan/phpstan-src/commit/106526db8bd64880af81faa61d9f970e793e3c38), [#1885](https://togithub.com/phpstan/phpstan/issues/1885), [#8536](https://togithub.com/phpstan/phpstan/issues/8536), [#8092](https://togithub.com/phpstan/phpstan/issues/8092) - Understand `get_class` compared with `static::class` (https://github.com/phpstan/phpstan-src/commit/590eb03e0ce2b5b02562ee9bb0af803fcbb1dc95), [#1885](https://togithub.com/phpstan/phpstan/issues/1885) - Understand `gettype` when there's a union of strings on the other side (https://github.com/phpstan/phpstan-src/commit/36e412ffed0ab6f4220c58276b06041a7a487db3), [#6294](https://togithub.com/phpstan/phpstan/issues/6294), [#2580](https://togithub.com/phpstan/phpstan/issues/2580) - Treat ConstantArrayType as covariant in its keys and values ([#2464](https://togithub.com/phpstan/phpstan-src/pull/2464)), [#9161](https://togithub.com/phpstan/phpstan/issues/9161), thanks [@jiripudil](https://togithub.com/jiripudil)! - Treat ArrayType as covariant in its keys and values ([#2465](https://togithub.com/phpstan/phpstan-src/pull/2465)), thanks [@jiripudil](https://togithub.com/jiripudil)! - Make `NonEmptyArrayType::toArray()` return `$this` ([#2349](https://togithub.com/phpstan/phpstan-src/pull/2349)), [#9208](https://togithub.com/phpstan/phpstan/issues/9208), thanks [@zonuexe](https://togithub.com/zonuexe)! - Retain list type via `array_push()` and `array_unshift()` ([#2451](https://togithub.com/phpstan/phpstan-src/pull/2451)), [#8449](https://togithub.com/phpstan/phpstan/issues/8449), thanks [@herndlm](https://togithub.com/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](https://togithub.com/phpstan/phpstan/issues/9459) # Internals 🔍 - Remove redundant conditions from RemoveUnusedCodeByPhpVersionIdVisitor. ([#2459](https://togithub.com/phpstan/phpstan-src/pull/2459)), thanks [@mad-briller](https://togithub.com/mad-briller)! - Return early in CachingVistor to avoid always-false instanceof checks. ([#2460](https://togithub.com/phpstan/phpstan-src/pull/2460)), thanks [@mad-briller](https://togithub.com/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)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
Read more information about the use of Renovate Bot.