-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
CarbonImmutable Macro Causes PHPStan Internal Error #2828
Comments
Hello, I went to the line And we do: |
@kylekatarnls thanks for looking into it! |
@kylekatarnls the error does not happen with the following versions:
|
Hi, I've fixed a similar problem in PHPStan, it might have fixed this problem too: phpstan/phpstan#9776 |
@LukeAbell Please check if From here I'm unable to reproduce the issue with any version of phpstan (on Laravel 10, with carbon 2.69.0 and larastan 2.6.4) If you still have the issue with the latest PHPStan 1.11.x-dev, please create a small repository that reproduces the problem and re-open the issue. |
Hello, I was able to get the same error with PHPStan |
|
Hello,
I encountered an issue with the following code:
When using a CarbonImmutable macro in Laravel v10, PHPStan throws an error.
Internal error: Internal error: No closure found on line 161 in AppServiceProvider.php.
Line 161:
It does not error when using standard Carbon macros, but we use CarbonImmutable everywhere so need them defined there.
Carbon version: 2.68.1
PHP version: 8.1
I expected to get:
But I actually get:
Stack Trace
I opened an issue in the PHPStan repo but they pointed me here.
Thanks!
The text was updated successfully, but these errors were encountered: