-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to undefined method PHPStan\Type\IntersectionType::getClassName() #1567
Comments
Thank you for your report! Could you share few lines from |
We are experiencing this same issue after upgrading to Laravel 10, PHPStan 1.10.3 and Larastan 2.4.1. We were able to get around it by pinning our Larastan version to 2.4.0 but obviously we would like to be able to upgrade when possible. |
Caused by #1543 |
Looking at the class: https://github.com/nunomaduro/larastan/blob/master/src/Properties/HigherOrderCollectionProxyPropertyExtension.php The assumptions in inline |
@szepeviktor It looks like you guys might be finding the issue but in case it helps, I upgraded to 2.4.1 again and looked at the files that it's erroring on and none of them are using Intersection Types. We've only been on PHP 8.1 for a couple months so we haven't started using that kind of stuff yet. |
Thanks everyone for your help,
I took a closer look at this file and I found what's responsible for triggering this error (for this file only, I still have to inspect the 4 other concerned classes), it's because of a missing type for indexes in a Collection parameter on the constructor: class ServiceRecurringPeriodWithQuantity {
/**
* @param Collection<ServiceRecurringPeriod> $services_recurring_periods
*/
public function __construct(Collection $services_recurring_periods) {}
} It triggers the following error:
If I add a type for indexes, no error: class ServiceRecurringPeriodWithQuantity {
/**
* @param Collection<int|string, ServiceRecurringPeriod> $services_recurring_periods
*/
public function __construct(Collection $services_recurring_periods) {}
} I hope this can help. Thanks again. |
I still keep getting this error for UnionType and ObjectType, even after running composer update. |
@ZejdCicak With 2.5.1? Please open a new issue with full example and stacktrace. |
@canvural It seems like my local PHPStan was not up to date, after updating it no issues. Sorry for the mistake. |
FYI this problem gave me an idea for a rule (disallow narrowing Because Here's the result on Larastan (not the latest commit, some stuff might already be fixed): https://github.com/phpstan/phpstan/actions/runs/4366265252/jobs/7636058806 |
I didn't check the results, I'm on the phone. But one question is that sometimes in the extensions we use |
For example: check something in the has* method and return false based on that. Check the same thing in the get* method and |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev | patch | `^1.10.5` -> `^1.10.6` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>phpstan/phpstan</summary> ### [`v1.10.6`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.6) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.5...1.10.6) # Bleeding edge 🔪 - Report narrowing `PHPStan\Type\Type` interface via `@var` (phpstan/phpstan-src@713b98f), [https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389](https://togithub.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389) - Check invalid PHPDocs in previously unchecked statement types (phpstan/phpstan-src@9780d35) - InvalidPHPStanDocTagRule in StubValidator (phpstan/phpstan-src@9c2552b) *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)* # Improvements 🔧 - InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (phpstan/phpstan-src@d943d58) # Bugfixes 🐛 - Fix false positive with `array_combine()` on PHP 8+ ([#​2276](https://togithub.com/phpstan/phpstan-src/pull/2276)), [#​9011](https://togithub.com/phpstan/phpstan/issues/9011), thanks [@​staabm](https://togithub.com/staabm)! - Ignore Nop nodes in NodeScopeResolver when creating UnreachableStatementNode ([#​2279](https://togithub.com/phpstan/phpstan-src/pull/2279)), [#​8966](https://togithub.com/phpstan/phpstan/issues/8966), thanks [@​herndlm](https://togithub.com/herndlm)! - Fix wrong positives about templates in conditional types ([#​2241](https://togithub.com/phpstan/phpstan-src/pull/2241)), [#​8609](https://togithub.com/phpstan/phpstan/issues/8609), [#​7310](https://togithub.com/phpstan/phpstan/issues/7310), [#​8408](https://togithub.com/phpstan/phpstan/issues/8408), thanks [@​KmeCnin](https://togithub.com/KmeCnin)! </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ben-challis/sql-migrations). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTkuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE1OS4yIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev | patch | `^1.10.4` -> `^1.10.6` | | [phpunit/phpunit](https://phpunit.de/) ([source](https://togithub.com/sebastianbergmann/phpunit)) | require-dev | patch | `^10.0.14` -> `^10.0.15` | --- ### Release Notes <details> <summary>phpstan/phpstan</summary> ### [`v1.10.6`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.6) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.5...1.10.6) # Bleeding edge 🔪 - Report narrowing `PHPStan\Type\Type` interface via `@var` (phpstan/phpstan-src@713b98f), [https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389](https://togithub.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389) - Check invalid PHPDocs in previously unchecked statement types (phpstan/phpstan-src@9780d35) - InvalidPHPStanDocTagRule in StubValidator (phpstan/phpstan-src@9c2552b) *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)* # Improvements 🔧 - InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (phpstan/phpstan-src@d943d58) # Bugfixes 🐛 - Fix false positive with `array_combine()` on PHP 8+ ([#​2276](https://togithub.com/phpstan/phpstan-src/pull/2276)), [#​9011](https://togithub.com/phpstan/phpstan/issues/9011), thanks [@​staabm](https://togithub.com/staabm)! - Ignore Nop nodes in NodeScopeResolver when creating UnreachableStatementNode ([#​2279](https://togithub.com/phpstan/phpstan-src/pull/2279)), [#​8966](https://togithub.com/phpstan/phpstan/issues/8966), thanks [@​herndlm](https://togithub.com/herndlm)! - Fix wrong positives about templates in conditional types ([#​2241](https://togithub.com/phpstan/phpstan-src/pull/2241)), [#​8609](https://togithub.com/phpstan/phpstan/issues/8609), [#​7310](https://togithub.com/phpstan/phpstan/issues/7310), [#​8408](https://togithub.com/phpstan/phpstan/issues/8408), thanks [@​KmeCnin](https://togithub.com/KmeCnin)! ### [`v1.10.5`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.5) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.4...1.10.5) # Improvements 🔧 - Check local type aliases above traits (phpstan/phpstan-src@4654c16) # Bugfixes 🐛 - Fix type aliases in method-level template types (phpstan/phpstan-src@c926144), [#​9008](https://togithub.com/phpstan/phpstan/issues/9008) - Fix type aliases in traits (phpstan/phpstan-src@60021c2), [#​5091](https://togithub.com/phpstan/phpstan/issues/5091) - Fix interface accepting a Closure (phpstan/phpstan-src@0dbe3ab), [#​9006](https://togithub.com/phpstan/phpstan/issues/9006) - Process enum case expression (phpstan/phpstan-src@f64b27c), [#​9005](https://togithub.com/phpstan/phpstan/issues/9005) - Fixed missing processing of UseUse and GroupUse (phpstan/phpstan-src@b797512) </details> <details> <summary>sebastianbergmann/phpunit</summary> ### [`v10.0.15`](https://togithub.com/sebastianbergmann/phpunit/compare/10.0.14...10.0.15) [Compare Source](https://togithub.com/sebastianbergmann/phpunit/compare/10.0.14...10.0.15) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Lendable/composer-license-checker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTcuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE1OS4yIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev | minor | `~1.9.0` -> `~1.10.0` | --- ### Release Notes <details> <summary>phpstan/phpstan</summary> ### [`v1.10.6`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.6) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.5...1.10.6) # Bleeding edge 🔪 - Report narrowing `PHPStan\Type\Type` interface via `@var` (phpstan/phpstan-src@713b98f), [https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389](https://togithub.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389) - Check invalid PHPDocs in previously unchecked statement types (phpstan/phpstan-src@9780d35) - InvalidPHPStanDocTagRule in StubValidator (phpstan/phpstan-src@9c2552b) *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)* # Improvements 🔧 - InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (phpstan/phpstan-src@d943d58) # Bugfixes 🐛 - Fix false positive with `array_combine()` on PHP 8+ ([#​2276](https://togithub.com/phpstan/phpstan-src/pull/2276)), [#​9011](https://togithub.com/phpstan/phpstan/issues/9011), thanks [@​staabm](https://togithub.com/staabm)! - Ignore Nop nodes in NodeScopeResolver when creating UnreachableStatementNode ([#​2279](https://togithub.com/phpstan/phpstan-src/pull/2279)), [#​8966](https://togithub.com/phpstan/phpstan/issues/8966), thanks [@​herndlm](https://togithub.com/herndlm)! - Fix wrong positives about templates in conditional types ([#​2241](https://togithub.com/phpstan/phpstan-src/pull/2241)), [#​8609](https://togithub.com/phpstan/phpstan/issues/8609), [#​7310](https://togithub.com/phpstan/phpstan/issues/7310), [#​8408](https://togithub.com/phpstan/phpstan/issues/8408), thanks [@​KmeCnin](https://togithub.com/KmeCnin)! ### [`v1.10.5`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.5) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.4...1.10.5) # Improvements 🔧 - Check local type aliases above traits (phpstan/phpstan-src@4654c16) # Bugfixes 🐛 - Fix type aliases in method-level template types (phpstan/phpstan-src@c926144), [#​9008](https://togithub.com/phpstan/phpstan/issues/9008) - Fix type aliases in traits (phpstan/phpstan-src@60021c2), [#​5091](https://togithub.com/phpstan/phpstan/issues/5091) - Fix interface accepting a Closure (phpstan/phpstan-src@0dbe3ab), [#​9006](https://togithub.com/phpstan/phpstan/issues/9006) - Process enum case expression (phpstan/phpstan-src@f64b27c), [#​9005](https://togithub.com/phpstan/phpstan/issues/9005) - Fixed missing processing of UseUse and GroupUse (phpstan/phpstan-src@b797512) ### [`v1.10.4`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.4) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.3...1.10.4) # Improvements 🔧 - Remove 3 leading spaces in PHAR ([#​2254](https://togithub.com/phpstan/phpstan-src/pull/2254)), [#​8952](https://togithub.com/phpstan/phpstan/issues/8952), thanks [@​ruudk](https://togithub.com/ruudk)! - Add missing newline at the end of the file ([#​2254](https://togithub.com/phpstan/phpstan-src/pull/2254)), thanks [@​ruudk](https://togithub.com/ruudk)! - RuleError interfaces are part of BC promise (phpstan/phpstan-src@aed9319) - Update nikic/php-parser (phpstan/phpstan-src@dda95b4) - Update BetterReflection ([#​2274](https://togithub.com/phpstan/phpstan-src/pull/2274)), [#​8889](https://togithub.com/phpstan/phpstan/issues/8889) # Bugfixes 🐛 - Fix bug with `array_column` ([#​2244](https://togithub.com/phpstan/phpstan-src/pull/2244)), [#​8917](https://togithub.com/phpstan/phpstan/issues/8917), thanks [@​VincentLanglet](https://togithub.com/VincentLanglet)! - Improve `filter_var()` handling of a couple of simple scalars and null ([#​2262](https://togithub.com/phpstan/phpstan-src/pull/2262)), thanks [@​herndlm](https://togithub.com/herndlm)! - Fix `value-of` for multiple enums (phpstan/phpstan-src@3adc91d), [#​8983](https://togithub.com/phpstan/phpstan/issues/8983) - Fix `->value` on unions of enums (phpstan/phpstan-src@05b85ba), [#​9000](https://togithub.com/phpstan/phpstan/issues/9000) # Function signature fixes 🤖 - Fix return type of `Ds\Sequence::copy()` ([#​1954](https://togithub.com/phpstan/phpstan-src/pull/1954)), thanks [@​MidnightDesign](https://togithub.com/MidnightDesign)! - Fix `password_hash()` return type ([#​2260](https://togithub.com/phpstan/phpstan-src/pull/2260)), [#​5978](https://togithub.com/phpstan/phpstan/issues/5978), thanks [@​VincentLanglet](https://togithub.com/VincentLanglet)! ### [`v1.10.3`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.3) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.2...1.10.3) # Improvements 🔧 - Add support for `@not-deprecated` annotation ([#​2255](https://togithub.com/phpstan/phpstan-src/pull/2255)), [https://github.com/phpstan/phpstan/discussions/7422](https://togithub.com/phpstan/phpstan/discussions/7422), thanks [@​stof](https://togithub.com/stof)! # Bugfixes 🐛 - Fix arithmetic operations with BenevolentUnionType (phpstan/phpstan-src@f882eff), [#​8938](https://togithub.com/phpstan/phpstan/issues/8938) - Fix native return type of `array_chunk()` (phpstan/phpstan-src@e4a6d20), [#​8956](https://togithub.com/phpstan/phpstan/issues/8956) - Support for property fetch in initializers (phpstan/phpstan-src@53c643d), [#​8957](https://togithub.com/phpstan/phpstan/issues/8957) - ObjectType - fix enum property with subtracted type (phpstan/phpstan-src@eb00fd2), [#​8828](https://togithub.com/phpstan/phpstan/issues/8828), [#​8486](https://togithub.com/phpstan/phpstan/issues/8486) ### [`v1.10.2`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.2) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.1...1.10.2) # Improvements 🔧 - Allow generating baseline in .php format (phpstan/phpstan-src@8260032), [#​8870](https://togithub.com/phpstan/phpstan/issues/8870) - See documentation: https://phpstan.org/user-guide/baseline#php-baseline-format-instead-of-neon # Function signature fixes 🤖 - Instances of `object` returned by `db2_*()` functions are always instances of `stdClass` ([#​2249](https://togithub.com/phpstan/phpstan-src/pull/2249)), thanks [@​phansys](https://togithub.com/phansys)! ### [`v1.10.1`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.1) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.10.0...1.10.1) # Bugfixes 🐛 - Fix match expression and `treatPhpDocTypesAsCertain: false` ([#​2248](https://togithub.com/phpstan/phpstan-src/pull/2248)), [#​8932](https://togithub.com/phpstan/phpstan/issues/8932), thanks [@​VincentLanglet](https://togithub.com/VincentLanglet)! - Fix calling dynamic return type extensions on nullable types (phpstan/phpstan-src@7331bc5) - Fix edge case with `in_array` and enums (phpstan/phpstan-src@7d6f0f6) ### [`v1.10.0`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.0) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.18...1.10.0) **Read the article about this release: [PHPStan 1.10 Comes With a Lie Detector](https://phpstan.org/blog/phpstan-1-10-comes-with-lie-detector)** # Major new features 🚀 - "Always true" conditions in the last `elseif` branch and last match expression arm are not reported by default ([#​2105](https://togithub.com/phpstan/phpstan-src/pull/2105)), [#​8042](https://togithub.com/phpstan/phpstan/issues/8042), [#​8485](https://togithub.com/phpstan/phpstan/issues/8485), [#​7721](https://togithub.com/phpstan/phpstan/issues/7721), [#​4242](https://togithub.com/phpstan/phpstan/issues/4242), [#​8240](https://togithub.com/phpstan/phpstan/issues/8240), thanks [@​staabm](https://togithub.com/staabm)! - Set [`reportAlwaysTrueInLastCondition`](https://phpstan.org/config-reference#reportalwaystrueinlastcondition) to `true` to have them reported again - Note: "Always true" conditions in PHPStan 1.x are reported with Bleeding Edge enabled, or with phpstan-strict-rules installed, or with [relevant options](https://togithub.com/phpstan/phpstan-strict-rules/blob/66b378f5b242130908b8a2222bf8110f14f4375a/rules.neon#L4-L7) enabled separately. In PHPStan 2.0 they're going to be always reported, except for the last `elseif` branch and last match expression arm. - Deprecate various `instanceof *Type` in favour of new methods on `Type` interface, (phpstan/phpstan-src@436e6d3), learn more: [Why Is instanceof \*Type Wrong and Getting Deprecated?](https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated) - Deprecations in your custom rules and extensions will be reported in Bleeding Edge, or with `phpstan-deprecation-rules` installed - Explain why type isn't accepted by another type in less intuitive scenarios, [#​3281](https://togithub.com/phpstan/phpstan/issues/3281), [#​6787](https://togithub.com/phpstan/phpstan/issues/6787) - Some examples: https://phpstan.org/r/61cfbb65-1a04-471a-a5c5-d61f0540ae1d, https://phpstan.org/r/839f1fd2-d66a-4356-af21-3fe171d83fd1, https://phpstan.org/r/2bea7ece-6b26-4dc9-a1cf-d2f0e7fbb9d6, https://phpstan.org/r/fed1c275-46d0-434f-b9c4-3212f4df6d1c, https://phpstan.org/r/24a23b74-af27-4443-986c-04af61427d50 # Bleeding edge 🔪 - Validate inline PHPDoc `@var` tag type against native type (phpstan/phpstan-src@a69e3bc) - Set [`reportWrongPhpDocTypeInVarTag`](https://phpstan.org/config-reference#reportwrongphpdoctypeinvartag) to `true` to have all types validated, not just native ones - Always report always true conditions, except for last elseif and match arm ([#​2105](https://togithub.com/phpstan/phpstan-src/pull/2105)), thanks [@​staabm](https://togithub.com/staabm)! - Disable "unreachable branches" rules: UnreachableIfBranchesRule, UnreachableTernaryElseBranchRule, unreachable arm error in MatchExpressionRule - Because "always true" is always reported, these are no longer needed - IncompatibleDefaultParameterTypeRule for closures (phpstan/phpstan-src@0264f5b) - New `RuleLevelHelper::accepts()` behaviour (phpstan/phpstan-src@941fc81) - Check template type variance in `@param-out` (phpstan/phpstan-src@7ceb19d), [https://github.com/phpstan/phpstan/issues/8880#issuecomment-1426971473](https://togithub.com/phpstan/phpstan/issues/8880#issuecomment-1426971473) *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)* # Improvements 🔧 - Implement identical/equal comparisons on EnumCaseObjectType ([#​2105](https://togithub.com/phpstan/phpstan-src/pull/2105)), thanks [@​staabm](https://togithub.com/staabm)! - MatchExpressionRule - use ConstantConditionRuleHelper to remove some duplicate errors (phpstan/phpstan-src@7380ed0) - Improvements of `MutatingScope::getNativeType()` ([#​1943](https://togithub.com/phpstan/phpstan-src/pull/1943)), [#​4689](https://togithub.com/phpstan/phpstan/issues/4689), [#​7578](https://togithub.com/phpstan/phpstan/issues/7578), [#​6260](https://togithub.com/phpstan/phpstan/issues/6260) - Allow default values for allow-private-mutation properties ([#​2178](https://togithub.com/phpstan/phpstan-src/pull/2178)), [#​8701](https://togithub.com/phpstan/phpstan/issues/8701), thanks [@​zonuexe](https://togithub.com/zonuexe)! - Support `treatPhpDocTypesAsCertain` in NumberComparisonOperatorsConstantConditionRule (phpstan/phpstan-src@649eb70), [#​6776](https://togithub.com/phpstan/phpstan/issues/6776), [#​7075](https://togithub.com/phpstan/phpstan/issues/7075) - JsonErrorFormatter - strip console-specific characters from tip (phpstan/phpstan-src@6419da7) - `InClassMethodNode` - add `getClassReflection()` (phpstan/phpstan-src@c4ee0b8) - PhpFunctionFromParserNodeReflection and PhpMethodFromParserNodeReflection are part of BC promise (phpstan/phpstan-src@8107179) - AttributesCheck - detect deprecated attributes (phpstan/phpstan-src@e46b0b4) - Introduce `Type::getTemplateType()` and deprecate `GenericTypeVariableResolver` (phpstan/phpstan-src@b73a8aa, phpstan/phpstan-src@01b4d4e) - Implement PHP version dependent loose const comparison ([#​2220](https://togithub.com/phpstan/phpstan-src/pull/2220), [#​2225](https://togithub.com/phpstan/phpstan-src/pull/2225)), thanks [@​staabm](https://togithub.com/staabm)! # Bugfixes 🐛 - Fix LateResolvableTypeTrait (phpstan/phpstan-src@bc28286) - StrCaseFunctionsReturnTypeExtension - do not throw ShouldNotHappenException, it might happen if mbstring is not enabled and the polyfill is not implemented (phpstan/phpstan-src@c015e47), [#​8925](https://togithub.com/phpstan/phpstan/issues/8925) # Function signature fixes 🤖 - Fix `PDO::sqliteCreateFunction` ([#​2208](https://togithub.com/phpstan/phpstan-src/pull/2208)), [#​8802](https://togithub.com/phpstan/phpstan/issues/8802), thanks [@​VincentLanglet](https://togithub.com/VincentLanglet)! - Use "numeric-string" type for some MySQLi functions ([#​2223](https://togithub.com/phpstan/phpstan-src/pull/2223), [#​2224](https://togithub.com/phpstan/phpstan-src/pull/2224)), thanks [@​phansys](https://togithub.com/phansys)! - Update param and return type for `db2_autocommit()` ([#​2239](https://togithub.com/phpstan/phpstan-src/pull/2239)), thanks [@​phansys](https://togithub.com/phansys)! # Internals 🔍 - Deprecate `TypeUtils::getDirectClassNames()` and `instanceof TypeWithClassName`, use `Type::getObjectClassNames()` instead ([#​1924](https://togithub.com/phpstan/phpstan-src/pull/1924)), thanks [@​herndlm](https://togithub.com/herndlm)! - Remove dead code in UnionType ([#​2194](https://togithub.com/phpstan/phpstan-src/pull/2194)), thanks [@​staabm](https://togithub.com/staabm)! - Use `isSuperTypeOf()` instead of `accepts()` in the right places (phpstan/phpstan-src@ddb9dc5) - Modernized `IncompatibleDefaultParameterTypeRule` (phpstan/phpstan-src@a79ad03) - InClassMethodNode always contains PhpMethodFromParserNodeReflection (phpstan/phpstan-src@01a7897) - InFunctionNode always contains PhpFunctionFromParserNodeReflection (phpstan/phpstan-src@e864b24) - Modernized InClassMethodNode rules (phpstan/phpstan-src@c3da6a9) - Modernized InFunctionNode rules (phpstan/phpstan-src@b736ddc) - Introduce `Type::acceptsWithReason()` (phpstan/phpstan-src@b763bd9), [#​3281](https://togithub.com/phpstan/phpstan/issues/3281) - Fix invalid phpdocs missing null ([#​2213](https://togithub.com/phpstan/phpstan-src/pull/2213)), thanks [@​janedbal](https://togithub.com/janedbal)! - NodeScopeResolver::earlyTerminatingMethodNames remove useless default ([#​2214](https://togithub.com/phpstan/phpstan-src/pull/2214)), [#​8830](https://togithub.com/phpstan/phpstan/issues/8830), thanks [@​janedbal](https://togithub.com/janedbal)! - Skip `testEditorUrlWithRelativePath()` test on PhpStorm console ([#​2229](https://togithub.com/phpstan/phpstan-src/pull/2229)), thanks [@​staabm](https://togithub.com/staabm)! - VarianceCheck - accept only ParametersAcceptorWithPhpDocs (phpstan/phpstan-src@7da13f7) - Remove duplicate method definition from ConstantType interface (phpstan/phpstan-src@61fa3a1) - `Type::isEnum()` (phpstan/phpstan-src@93113cb) - `Type::getObjectClassReflections()` (phpstan/phpstan-src@4c7046e) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/open-feature/php-sdk). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDguMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
--level
used: 9Hello, I have an issue with PHPStan v1.10.3 and Larastan v2.4.1 in a Laravel project since I upgraded it to Laravel 10. I reported it on PHPStan issues tracker and @ondrejmirtes told me it's a bug from Larastan.
Please find bellow a copy of what I already reported to PHPStan:
Hello, I have an issue with PHPStan v1.10.3 in a Laravel project since I upgraded it to Laravel 10.I don't know how to reproduce the problem because the error refers to a getClassName() method, which is never used anywhere in my codebase. I guess this is an internal PHPStan function.
This error is reported from 5 of my classes but I don't know what is so specific about them.
I can't reproduce this issue with https://phpstan.org/try because the code needs Laravel as a dependency.
Below is the output from PHPStan, with the corresponding call trace for 2 of the 5 concerned files (I can't post the 5 call traces here since the output is too long for this form). I hope it can be enough for you to identify what the problem is.
Thanks, please let me know if you need anything else.
The text was updated successfully, but these errors were encountered: