Skip to content

Commit

Permalink
Add Application::removeDeferredServices method (#53362)
Browse files Browse the repository at this point in the history
* Add Application::removeDeferredServices method

* Update Application.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
ollieread and taylorotwell authored Oct 31, 2024
1 parent 79897cd commit 16bf809
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,17 @@ public function setDeferredServices(array $services)
$this->deferredServices = $services;
}

/**
* Determine if the given service is a deferred service.
*
* @param string $service
* @return bool
*/
public function isDeferredService($service)
{
return isset($this->deferredServices[$service]);
}

/**
* Add an array of services to the application's deferred services.
*
Expand All @@ -1477,14 +1488,16 @@ public function addDeferredServices(array $services)
}

/**
* Determine if the given service is a deferred service.
* Remove an array of services from the application's deferred services.
*
* @param string $service
* @return bool
* @param array $services
* @return void
*/
public function isDeferredService($service)
public function removeDeferredServices(array $services)
{
return isset($this->deferredServices[$service]);
foreach ($services as $service) {
unset($this->deferredServices[$service]);
}
}

/**
Expand Down

0 comments on commit 16bf809

Please sign in to comment.