Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
gdarko committed Oct 21, 2022
0 parents commit d41c576
Show file tree
Hide file tree
Showing 70 changed files with 10,804 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 IgniteKit\Backports\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;
}
}
Loading

0 comments on commit d41c576

Please sign in to comment.