-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Weird behaviour of Connection class #18209
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
Comments
What warnings are you getting? If you are passing |
I am getting "wrong argument number" warning not passing any, but I get the whole configuration, or if I pass null I don't get the warning and I still get all the configuration array. |
Sorry but Laravel 4 is not supported anymore, please use the forums to post such questions. |
@themsaid wasnt really about laravel 4, I am using 5.3, I was reporting that this weird behaviour is happening since laravel 4.* |
* #18209 implementing fix proposed on the issue * Update Connection.php
* laravel/framework#18209 implementing fix proposed on the issue * Update Connection.php
Description:
I am using the standalone Eloquent in one small project, and to re-use the same db connection configuration I used
Connection::getConfig($option)
method (https://github.com/laravel/framework/blob/5.4/src/Illuminate/Database/Connection.php#L963), passing a void instead of the $option.And it returned the whole config array (which is what I originally wanted to be honest), but if you put the errors on you will get some warnings related to the call this object does to
Arr::get()
method, since$key
is null.Is this a wanted behaviour?
I was thinking to open a PR to change this piece of code to be a avoid throwing errors, something like:
Can I do that? Or would be better to create another getter
Steps To Reproduce:
Just call this method without parameter
$dbConfig
will have your config array, but some errors related to the wayArr::get
handles the null value of key will be thrownThe text was updated successfully, but these errors were encountered: