Can't register a singleton with a SoapClient in the constructor #33146
Unanswered
MarianNapi
asked this question in
General
Replies: 2 comments 3 replies
-
Moving to discussions |
Beta Was this translation helpful? Give feedback.
0 replies
-
Because the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've created a new ServiceProvider and added it to the app.php. I then registered a singleton with a test class which has a SoapClient in it's constructor:
$this->app->singleton( Test::class, function () { return new Test(new SoapClient(null)); } );
I then get this error when trying to get the class like this:
app(Test::class)
It doesn't matter wether I use null or a real wsdl as SoapClient parameter, the error stays the same.
Beta Was this translation helpful? Give feedback.
All reactions