-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 a member function getMethods() on null #1084
Comments
Can you debug which method this is about? Also maybe the code is simply buggy as |
This seems to be caused by invokable classes. This how to reproduce this issue: Versions:
Step 1.Create class <?php
namespace App;
class Foo
{
public function __invoke($var)
{
return $var;
}
} Step 2.Register the macro by passing a new instance of <?php
namespace App\Providers;
use App\Foo;
// ...
class AppServiceProvider extends ServiceProvider
{
public function register()
{
UrlGenerator::macro('foo', new Foo());
}
// ...
} Step 3.Run Result
Logging the value of
|
I don't use these kind of things 🤷♀️ Can you propose a PR / test to fix this? |
Fixed with #1124 |
@mfn the PR seems to have broken some of my classes. I'm proposing this change as a fix. I'll submit a PR if you're happy with the change |
But this change then will not support Basically: yes, please make a PR but from a quick look just replacing it with |
@mfn thanks. I'll have another look at my proposed change and make changes if necessary and create the PR. Thanks. |
I still have
in some cases $enclosingClass is null I have 2.10.0 version installed |
I also still have this issue. I enabled debugging and I can see that the problem stems from some other package I installed that adds a macro on the Request. This causes a problem in |
I propose a quick, probably naive, fix here: #1239 |
Versions:
Description:
I recently try to run the command below and I got this error:
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: