Skip to content

Commit

Permalink
Skytells PHP Support Pack
Browse files Browse the repository at this point in the history
  • Loading branch information
Skytells, Inc committed Dec 30, 2017
0 parents commit 971c1d6
Show file tree
Hide file tree
Showing 67 changed files with 7,873 additions and 0 deletions.
52 changes: 52 additions & 0 deletions AggregateServiceProvider.php
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;
}
}

0 comments on commit 971c1d6

Please sign in to comment.