-
-
Notifications
You must be signed in to change notification settings - Fork 401
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
Autoload is maybe wrong: Cannot redeclare Safe\array_combine() #741
Comments
Actually you need two |
Want to see stange things? Replace the contents of error_log('-----------------------------------------------------------------------------------------------');
var_export(debug_backtrace(0, 6)); |
Okay, the tests seems to complain about your changes... Will there be a new version? |
@canvural Could you chime in? |
I've made a fix in |
It seems like the autoloading problem is in our side, in Larastan. |
Hi, From the example repo you created, file |
I'm sorry to comment back on a closed issue, but I believe the issue is on larastan and this issue shouldn't be closed. I've been debugging it and the problem come from these lines, larastan is checking whether I'm a bit lost on the larastan code so I'm not sure why is trying to check whether Maybe the solution comes from finding out why larastan is trying to check |
By updating my test (thecodingmachine/phpstan-safe-rule#29 (comment)) with |
I'm afraid the issue is still present on packages :( So I guess you are right @canvural and the source wasn't (only) the use of @MJTheOne I just tested and the latest stable version of all the packages doesn't cause the issue on your setup either. For my tests I'm trying an updated version of the repo posted by OP. I'll try to dig further later in the day. Thanks for trying @canvural !! |
Ok, good news, I've found the issue, haha, and it turns out it's either on Safe's side or PHPStan's. It turns out that the PHPDocs on the functions defined on the Safe library use Now, using |
--level
used: 8Description
When running phpstan with larastan extension on specific functions this error happened. I created a repository to reproduce this:
https://github.com/nepda/phpstan-larastan-bug
Without larastan, it will run perfectly.
Laravel code where the issue was found
If you remove those lines:
it will run without errors.
This is related to: thecodingmachine/safe#253
The text was updated successfully, but these errors were encountered: