Skip to content

Conversation

@Anton5360
Copy link
Contributor

#52256 with no breaking change

@taylorotwell taylorotwell merged commit ff5cdef into laravel:11.x Jul 29, 2024
Comment on lines +14 to +15
* @property array<class-string, class-string> $bindings All of the container bindings that should be registered.
* @property array<class-string, class-string> $singletons All of the singletons that should be registered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types are wrong, because bindings (and singletons) don't need to be class strings. They should be typehinted as string instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also suggest singletons' key to be array-key type, since integer is allowed:

foreach ($provider->singletons as $key => $value) {
$key = is_int($key) ? $value : $key;
$this->singleton($key, $value);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to send in follow up PR's 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants