mirror of
https://github.com/jbcr/Win32ServiceBundle.git
synced 2026-03-24 08:52:10 +01:00
36 lines
726 B
PHP
36 lines
726 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* @copyright Macintoshplus (c) 2019
|
|
* Added by : Macintoshplus at 19/02/19 23:06
|
|
*/
|
|
|
|
namespace Win32ServiceBundle\Service;
|
|
|
|
use Win32Service\Model\RunnerServiceInterface;
|
|
|
|
class RunnerManager
|
|
{
|
|
/**
|
|
* @var RunnerServiceInterface[]
|
|
*/
|
|
private array $runner = [];
|
|
|
|
public function addRunner(RunnerServiceInterface $runner, string $alias): void
|
|
{
|
|
$this->runner[$alias] = $runner;
|
|
}
|
|
|
|
public function getRunner(string $alias): ?RunnerServiceInterface
|
|
{
|
|
return $this->runner[$alias] ?? null;
|
|
}
|
|
|
|
/** @return array<string, RunnerServiceInterface> */
|
|
public function getRunners(): array
|
|
{
|
|
return $this->runner;
|
|
}
|
|
}
|