phpstan/phpstan
### [`v0.12.85`](https://togithub.com/phpstan/phpstan/releases/0.12.85)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/0.12.84...0.12.85)
# Improvements π§
- TypeInferenceTestCase - allow 3rd parties same modern style of type inference testing as in NodeScopeResolverTest ([phpstan/phpstan-src@`3af8630`](https://togithub.com/phpstan/phpstan-src/commit/3af8630723f11a4683aae788903622c402ac3315)), documentation:
- Dynamic throw type extensions ([phpstan/phpstan-src@`2bf30bf`](https://togithub.com/phpstan/phpstan-src/commit/2bf30bff0b91e2c8144171ce6892fd9098183eff)), [#4814](https://togithub.com/phpstan/phpstan/issues/4814), [#4819](https://togithub.com/phpstan/phpstan/issues/4819), documentation:
- Nicer error when StubValidator throws an internal exception ([phpstan/phpstan-src@`008f324`](https://togithub.com/phpstan/phpstan-src/commit/008f32479b2107562a2bf35e6395dc8242c7ef57)), [phpstan/phpstan-symfony#148](https://togithub.com/phpstan/phpstan-symfony/pull/148)
# Bugfixes π
- Fixed `===` and `!==` type inference with `treatPhpDocTypesAsCertain: false` ([#476](https://togithub.com/phpstan/phpstan-src/pull/476)), thanks [@ruudk](https://togithub.com/ruudk)!
- Address [#4881](https://togithub.com/phpstan/phpstan/issues/4881) by implementing a more complete fake stream wrapper ([#501](https://togithub.com/phpstan/phpstan-src/pull/501)), thanks [@rrazor](https://togithub.com/rrazor)!
- Disable OPCache for PHP < 7.4.x, [#4881](https://togithub.com/phpstan/phpstan/issues/4881) ([#501](https://togithub.com/phpstan/phpstan-src/pull/501)), thanks [@rrazor](https://togithub.com/rrazor)!
- Read PHPDocs for built-in method even if the method has multiple variants ([phpstan/phpstan-src@`b48fd77`](https://togithub.com/phpstan/phpstan-src/commit/b48fd77987822a500fd9b304386d455d8cf3f1b9)), [#4821](https://togithub.com/phpstan/phpstan/issues/4821)
- `yield` has implicit throw point ([phpstan/phpstan-src@`033aeff`](https://togithub.com/phpstan/phpstan-src/commit/033aeffa4b63428934f5000092c582c028cdc53d)), [#4863](https://togithub.com/phpstan/phpstan/issues/4863)
- Built-in PHP functions without required parameters and no arguments passed do not have implicit throw point ([phpstan/phpstan-src@`09d3488`](https://togithub.com/phpstan/phpstan-src/commit/09d34887f805437a216a388aadce4bd83aaaab51)), [#4838](https://togithub.com/phpstan/phpstan/issues/4838)
- Throwable catch block also uses implicit throw points even when there are explicit ones ([phpstan/phpstan-src@`54a204e`](https://togithub.com/phpstan/phpstan-src/commit/54a204ee29a1ef64d2288a6ed4084c0abe121cd0)), [#4820](https://togithub.com/phpstan/phpstan/issues/4820), [#4879](https://togithub.com/phpstan/phpstan/issues/4879)
- MethodsClassReflectionExtension for SoapClient magic methods ([phpstan/phpstan-src@`f6107ad`](https://togithub.com/phpstan/phpstan-src/commit/f6107ad8ff07144d1f3c84a59e92303cbbf0ea04)), [#4822](https://togithub.com/phpstan/phpstan/issues/4822), [#262](https://togithub.com/phpstan/phpstan/issues/262)
- PHP does not cache `is_dir()` and similar function values for nonexistent files ([phpstan/phpstan-src@`1eaef04`](https://togithub.com/phpstan/phpstan-src/commit/1eaef0463d2347bdbef3612da158853519867d82)), [#4816](https://togithub.com/phpstan/phpstan/issues/4816)
- Severity field in GitLab error formatter, GitLab 13.x expects the field in code quality reports ([#504](https://togithub.com/phpstan/phpstan-src/pull/504)), thanks [@stockalexander](https://togithub.com/stockalexander)!
- Type-specified nullsafe call also removes null from the chain ([phpstan/phpstan-src@`6622401`](https://togithub.com/phpstan/phpstan-src/commit/662240117e38bdf3fa6628f767e8e3010e28dd9b)), [#4757](https://togithub.com/phpstan/phpstan/issues/4757), [#4690](https://togithub.com/phpstan/phpstan/issues/4690)
# Function signature fixes π€
- Dynamic return type extension for `date_create_from_format` and `date_create_immutable_from_format` ([#502](https://togithub.com/phpstan/phpstan-src/pull/502)), thanks [@pascalheidmann](https://togithub.com/pascalheidmann)!
### [`v0.12.84`](https://togithub.com/phpstan/phpstan/releases/0.12.84)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/0.12.83...0.12.84)
# Major new feature π
**Local type aliases**
Thanks to [@jiripudil](https://togithub.com/jiripudil) and his PR [phpstan/phpstan-src#460](https://togithub.com/phpstan/phpstan-src/pull/460), you can now enjoy `@phpstan-type` and `@phpstan-import-type` in class-level PHPDoc. [See the documentation for more details.](https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases)
# Improvements π§
- Add `AlwaysUsedClassConstantsExtension` interface ([#495](https://togithub.com/phpstan/phpstan-src/pull/495)), [#4859](https://togithub.com/phpstan/phpstan/issues/4859), thanks [@jdecool](https://togithub.com/jdecool)!
- Remove unnecessary dependencies ([phpstan/phpstan-src@`2cd7a03`](https://togithub.com/phpstan/phpstan-src/commit/2cd7a03473a26867d6d64f5f295e4cb875f8da50))
# Bugfixes π
- `unlink()` also clears stat cache ([phpstan/phpstan-src@`63d0670`](https://togithub.com/phpstan/phpstan-src/commit/63d06709e42d2b0540641fb6d0351624aa73b871)), [#4797](https://togithub.com/phpstan/phpstan/issues/4797)
- Named arguments - fix optional arguments and variadics ([phpstan/phpstan-src@`3e5621e`](https://togithub.com/phpstan/phpstan-src/commit/3e5621ea5471da1c10c40652498957e60a71eeb6)), [#4800](https://togithub.com/phpstan/phpstan/issues/4800)
- Fix `Closure::bind()` ([phpstan/phpstan-src@`566b44b`](https://togithub.com/phpstan/phpstan-src/commit/566b44b1c78346626156cf2e2939d6611db7cddd)), [#4808](https://togithub.com/phpstan/phpstan/issues/4808)
- Fix CatchWithUnthrownExceptionRule for `new $expr()` ([phpstan/phpstan-src@`8463afd`](https://togithub.com/phpstan/phpstan-src/commit/8463afd91e2c3a3740f4ef7de07cf77d9986d48e)), [#4806](https://togithub.com/phpstan/phpstan/issues/4806)
- Fix CatchWithUnthrownExceptionRule for `$expr::foo()` ([phpstan/phpstan-src@`8c7cf85`](https://togithub.com/phpstan/phpstan-src/commit/8c7cf85904337d3b2cfe795994fd1dcf6c670349)), [#4805](https://togithub.com/phpstan/phpstan/issues/4805)
- Allow autoloaders to `require`/`require_once` for [#4836](https://togithub.com/phpstan/phpstan/issues/4836) via a fake read ([#491](https://togithub.com/phpstan/phpstan-src/pull/491)), thanks [@rrazor](https://togithub.com/rrazor)!
- Get closer to how type inference in TypeScript works ([phpstan/phpstan-src@`3be90f0`](https://togithub.com/phpstan/phpstan-src/commit/3be90f0591fb7af732351e26d9e3e4af59372c1b)), [#4803](https://togithub.com/phpstan/phpstan/issues/4803)
- Fix throwpoint in elseif condition ([phpstan/phpstan-src@`fb62e5e`](https://togithub.com/phpstan/phpstan-src/commit/fb62e5ec90de7cd41a66c44eab27645b9368680d))
- Fix excessive memory usage ([phpstan/phpstan-src@`7c0146c`](https://togithub.com/phpstan/phpstan-src/commit/7c0146cf804344d702cfcf62fb7c70690a5cdc07)), [#4815](https://togithub.com/phpstan/phpstan/issues/4815)
# Function signature fixes π€
- Update XSLTProcessor::transformToXML signature ([#492](https://togithub.com/phpstan/phpstan-src/pull/492)), thanks [@jawira](https://togithub.com/jawira)!
- Update `rediscluster` inspections ([#493](https://togithub.com/phpstan/phpstan-src/pull/493)), thanks [@sudo-plz](https://togithub.com/sudo-plz)!
- Fix `array_sum` return type ([#494](https://togithub.com/phpstan/phpstan-src/pull/494)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Fix wrong IntlDateFormatter format signature ([#496](https://togithub.com/phpstan/phpstan-src/pull/496)), thanks [@alfredbez](https://togithub.com/alfredbez)!
### [`v0.12.83`](https://togithub.com/phpstan/phpstan/releases/0.12.83)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/0.12.82...0.12.83)
# Improvements π§
- **Precise try-catch-finally analysis** ([#481](https://togithub.com/phpstan/phpstan-src/pull/481)), thanks [@rainbow-alex](https://togithub.com/rainbow-alex) for the kick-off of this feature!
- [Learn more on PHPStan's blog](https://phpstan.org/blog/precise-try-catch-finally-analysis)
- Fixes: [#1597](https://togithub.com/phpstan/phpstan/issues/1597), [#3617](https://togithub.com/phpstan/phpstan/issues/3617), [#778](https://togithub.com/phpstan/phpstan/issues/778), [#2969](https://togithub.com/phpstan/phpstan/issues/2969), [#3004](https://togithub.com/phpstan/phpstan/issues/3004), [#3710](https://togithub.com/phpstan/phpstan/issues/3710), [#3822](https://togithub.com/phpstan/phpstan/issues/3822), [#505](https://togithub.com/phpstan/phpstan/issues/505), [#1670](https://togithub.com/phpstan/phpstan/issues/1670), [#1219](https://togithub.com/phpstan/phpstan/issues/1219), [#3302](https://togithub.com/phpstan/phpstan/issues/3302)
- Dependent types - understand truthy BooleanOr and falsey BooleanAnd scope ([phpstan/phpstan-src@`2c42ef1`](https://togithub.com/phpstan/phpstan-src/commit/2c42ef18ae4c2da04e10ba9519b09d16abe147aa)), [#4733](https://togithub.com/phpstan/phpstan/issues/4733), [#4326](https://togithub.com/phpstan/phpstan/issues/4326), [#987](https://togithub.com/phpstan/phpstan/issues/987), [#4215](https://togithub.com/phpstan/phpstan/issues/4215), [#4695](https://togithub.com/phpstan/phpstan/issues/4695)
- Dependent types - save conditional expression after variable assignment ([phpstan/phpstan-src@`56ae015`](https://togithub.com/phpstan/phpstan-src/commit/56ae015b578c3e38a74d70de807e4f42995936b7)), [#2977](https://togithub.com/phpstan/phpstan/issues/2977), [#3190](https://togithub.com/phpstan/phpstan/issues/3190)
# Bleeding edge πͺ
- **Consistent remembering and forgetting returned values** ([phpstan/phpstan-src@`d4edc59`](https://togithub.com/phpstan/phpstan-src/commit/d4edc59b36927a2d70f2e8665e657f99dd9d6be2))
- [Learn more on PHPStan's blog](https://phpstan.org/blog/remembering-and-forgetting-returned-values)
- Fixes: [#2420](https://togithub.com/phpstan/phpstan/issues/2420), [#4588](https://togithub.com/phpstan/phpstan/issues/4588), [#3553](https://togithub.com/phpstan/phpstan/issues/3553), [#3382](https://togithub.com/phpstan/phpstan/issues/3382), [#4177](https://togithub.com/phpstan/phpstan/issues/4177), [#4091](https://togithub.com/phpstan/phpstan/issues/4091), [#2288](https://togithub.com/phpstan/phpstan/issues/2288), [#1157](https://togithub.com/phpstan/phpstan/issues/1157)
- Report dead catch with exception that is not thrown in the try block - level 4 ([phpstan/phpstan-src@`ce9299c`](https://togithub.com/phpstan/phpstan-src/commit/ce9299c0e9ab55fc63d7a2e0814c99cc221cb514))
- Rule for detecting overwriting exit points in finally - level 4 ([phpstan/phpstan-src@`3f712be`](https://togithub.com/phpstan/phpstan-src/commit/3f712be7c4a840fcae3bb8d3ebfa888ead4e964e))
_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](https://phpstan.org/blog/what-is-bleeding-edge)_
# Bugfixes π
- Fixed detecting method signature compatibility ([phpstan/phpstan-src@`8f0150d`](https://togithub.com/phpstan/phpstan-src/commit/8f0150d6dc3252ae7ac3e951313923928d03a950)), [#4729](https://togithub.com/phpstan/phpstan/issues/4729)
- Fixed inferring template types from ThisType ([phpstan/phpstan-src@`a843d87`](https://togithub.com/phpstan/phpstan-src/commit/a843d871672498f08486a40f5b5c2b35212b4965)), [#4725](https://togithub.com/phpstan/phpstan/issues/4725)
- More robust PHPDoc parsing ([phpstan/phpstan-src@`5d37113`](https://togithub.com/phpstan/phpstan-src/commit/5d37113e5193da26b03c78c5eb64bc963556953f)), [#4731](https://togithub.com/phpstan/phpstan/issues/4731)
- Support the `$foo ?? false` pattern when making sure variable exists ([phpstan/phpstan-src@`c4cc668`](https://togithub.com/phpstan/phpstan-src/commit/c4cc66895946eaab81b54ff5b5f03dde607a0458)), [#560](https://togithub.com/phpstan/phpstan/issues/560)
- `mt_rand` and `rand` are not pure ([phpstan/phpstan-src@`edc8446`](https://togithub.com/phpstan/phpstan-src/commit/edc84462e42d690c62d90b165b21fb98451434bc))
- `random_int` and `random_bytes` are not deterministic ([phpstan/phpstan-src@`f36fa71`](https://togithub.com/phpstan/phpstan-src/commit/f36fa71374e831228cefe29f59ab9762a87cb11d)), [#4190](https://togithub.com/phpstan/phpstan/issues/4190)
- Invalidate `is_file()` calls and similar only after `clearstatcache()` ([phpstan/phpstan-src@`bcc8d61`](https://togithub.com/phpstan/phpstan-src/commit/bcc8d61a5ea435c277630d2f3ba9e709801eb3f0))
- Invalidate object state after passing to impure function ([phpstan/phpstan-src@`f92b95e`](https://togithub.com/phpstan/phpstan-src/commit/f92b95ed5d054c0fc0b2ad2e0a2460cf14a0c515)), [#3203](https://togithub.com/phpstan/phpstan/issues/3203)
- BaselineNeonErrorFormatter: Sort output by file and pattern ([#483](https://togithub.com/phpstan/phpstan-src/pull/483)), thanks [@dktapps](https://togithub.com/dktapps)!
- Match expression - do not complain about void in arm body ([phpstan/phpstan-src@`90e49f7`](https://togithub.com/phpstan/phpstan-src/commit/90e49f7074c0492d7480faabcfd9eb0de19ccfc9), [phpstan/phpstan-src@`2c0dda3`](https://togithub.com/phpstan/phpstan-src/commit/2c0dda3212bdd63df57d146822aa07ff0d412840)), [#4292](https://togithub.com/phpstan/phpstan/issues/4292)
- Fix merging scopes with narrowed constant types ([phpstan/phpstan-src@`42d0b36`](https://togithub.com/phpstan/phpstan-src/commit/42d0b363727a8acc7251e41f7ca0ef395630c547)), [#4434](https://togithub.com/phpstan/phpstan/issues/4434)
- Allow phpVersion up to 80099 ([phpstan/phpstan-src@`4db2e14`](https://togithub.com/phpstan/phpstan-src/commit/4db2e1427e0e45fb3f19cc2a8adc2852fb1e1fcd)), [#4762](https://togithub.com/phpstan/phpstan/discussions/4762)
- Fix Access to an undefined static property in `Closure::bind` ([#489](https://togithub.com/phpstan/phpstan-src/pull/489)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Add `array_sum()` dynamic return type extension ([#490](https://togithub.com/phpstan/phpstan-src/pull/490)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Fix `NativeMethodReflection::hasSideEffects()` ([phpstan/phpstan-src@`98fb540`](https://togithub.com/phpstan/phpstan-src/commit/98fb5404cba99a36494b2f9263ed429c283ce623)), [#4231](https://togithub.com/phpstan/phpstan/issues/4231), [#4287](https://togithub.com/phpstan/phpstan/issues/4287)
- TypeSpecifier - support IntegerRangeType with `count()` ([phpstan/phpstan-src@`7b417c7`](https://togithub.com/phpstan/phpstan-src/commit/7b417c7f3e9d95ded5187cbb58f39ebe0cf45d38)), [#4700](https://togithub.com/phpstan/phpstan/issues/4700)
- Improved performance ([phpstan/phpstan-src@`dbe08a6`](https://togithub.com/phpstan/phpstan-src/commit/dbe08a6feac7e98725fa8baec20c1309867e8f03), [phpstan/phpstan-src@`626f72a`](https://togithub.com/phpstan/phpstan-src/commit/626f72aaf408aa27422c74215599823999bed4dc), [phpstan/phpstan-src@`1463c57`](https://togithub.com/phpstan/phpstan-src/commit/1463c571cfe547cf7e17b42b81a8ec95ba7f0ff5), [phpstan/phpstan-src@`91f477f`](https://togithub.com/phpstan/phpstan-src/commit/91f477f040dad26f340214e43798910607f5d184)), [#4723](https://togithub.com/phpstan/phpstan/issues/4723)
- Fix problem with generics and inheritance, [#4008](https://togithub.com/phpstan/phpstan/issues/4008), [#3546](https://togithub.com/phpstan/phpstan/issues/3546)
- Fix native static return typehint when entering class method ([phpstan/phpstan-src@`baa371e`](https://togithub.com/phpstan/phpstan-src/commit/baa371e86541071fe6914c54efae8d3f2dbdd3f9)), [#4795](https://togithub.com/phpstan/phpstan/discussions/4795)
# Function signature fixes π€
- Fix function-map for PDOStatement pass-by-reference functions ([#480](https://togithub.com/phpstan/phpstan-src/pull/480)), thanks [@jaylinski](https://togithub.com/jaylinski)!
- Add uopz 6.x functions ([#482](https://togithub.com/phpstan/phpstan-src/pull/482)), thanks [@zonuexe](https://togithub.com/zonuexe)!
Configuration
π Schedule: At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β»οΈ Rebasing: Whenever PR becomes conflicted, 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:
0.12.82
->0.12.85
Release Notes
phpstan/phpstan
### [`v0.12.85`](https://togithub.com/phpstan/phpstan/releases/0.12.85) [Compare Source](https://togithub.com/phpstan/phpstan/compare/0.12.84...0.12.85) # Improvements π§ - TypeInferenceTestCase - allow 3rd parties same modern style of type inference testing as in NodeScopeResolverTest ([phpstan/phpstan-src@`3af8630`](https://togithub.com/phpstan/phpstan-src/commit/3af8630723f11a4683aae788903622c402ac3315)), documentation:Configuration
π Schedule: At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β»οΈ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.