Skip to content

Commit

Permalink
Revert "[11.x] Declare bindings and singletons properties in Service …
Browse files Browse the repository at this point in the history
…Provider…"

This reverts commit ed28a45.
  • Loading branch information
driesvints authored Jul 26, 2024
1 parent 36ad970 commit d49de4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
14 changes: 9 additions & 5 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,18 @@ public function register($provider, $force = false)
// If there are bindings / singletons set as properties on the provider we
// will spin through them and register them with the application, which
// serves as a convenience layer while registering a lot of bindings.
foreach ($provider->bindings as $key => $value) {
$this->bind($key, $value);
if (property_exists($provider, 'bindings')) {
foreach ($provider->bindings as $key => $value) {
$this->bind($key, $value);
}
}

foreach ($provider->singletons as $key => $value) {
$key = is_int($key) ? $value : $key;
if (property_exists($provider, 'singletons')) {
foreach ($provider->singletons as $key => $value) {
$key = is_int($key) ? $value : $key;

$this->singleton($key, $value);
$this->singleton($key, $value);
}
}

$this->markAsRegistered($provider);
Expand Down
14 changes: 0 additions & 14 deletions src/Illuminate/Support/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ abstract class ServiceProvider
*/
protected $app;

/**
* All of the container bindings that should be registered.
*
* @var array
*/
public $bindings = [];

/**
* All of the singletons that should be registered.
*
* @var array
*/
public $singletons = [];

/**
* All of the registered booting callbacks.
*
Expand Down

0 comments on commit d49de4b

Please sign in to comment.