-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Skytells, Inc
committed
Dec 30, 2017
0 parents
commit 971c1d6
Showing
67 changed files
with
7,873 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Skytells\Support; | ||
|
||
class AggregateServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* The provider class names. | ||
* | ||
* @var array | ||
*/ | ||
protected $providers = []; | ||
|
||
/** | ||
* An array of the service provider instances. | ||
* | ||
* @var array | ||
*/ | ||
protected $instances = []; | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->instances = []; | ||
|
||
foreach ($this->providers as $provider) { | ||
$this->instances[] = $this->app->register($provider); | ||
} | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
$provides = []; | ||
|
||
foreach ($this->providers as $provider) { | ||
$instance = $this->app->resolveProvider($provider); | ||
|
||
$provides = array_merge($provides, $instance->provides()); | ||
} | ||
|
||
return $provides; | ||
} | ||
} |
Oops, something went wrong.