eee
This commit is contained in:
+13
-10
@@ -87,20 +87,23 @@ class Application extends BaseApplication
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $service
|
* @param string ...$services
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function import(string $service): static
|
public function import(string ...$services): static
|
||||||
{
|
{
|
||||||
if (!class_exists($service)) {
|
foreach ($services as $service) {
|
||||||
return $this;
|
if (!class_exists($service)) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/** @var Kiri\Abstracts\Provider $class */
|
/** @var Kiri\Abstracts\Provider $class */
|
||||||
$class = $this->container->get($service);
|
$class = $this->container->get($service);
|
||||||
if (method_exists($class, 'onImport')) {
|
if (method_exists($class, 'onImport')) {
|
||||||
$class->onImport();
|
$class->onImport();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user