mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-10 17:03:52 +09:00
Updates to vendors etc
This commit is contained in:
@@ -22,22 +22,19 @@ use Symfony\Component\Console\Exception\CommandNotFoundException;
|
||||
*/
|
||||
class ContainerCommandLoader implements CommandLoaderInterface
|
||||
{
|
||||
private ContainerInterface $container;
|
||||
private array $commandMap;
|
||||
|
||||
/**
|
||||
* @param array $commandMap An array with command names as keys and service ids as values
|
||||
*/
|
||||
public function __construct(ContainerInterface $container, array $commandMap)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->commandMap = $commandMap;
|
||||
public function __construct(
|
||||
private ContainerInterface $container,
|
||||
private array $commandMap,
|
||||
) {
|
||||
}
|
||||
|
||||
public function get(string $name): Command
|
||||
{
|
||||
if (!$this->has($name)) {
|
||||
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
|
||||
throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
|
||||
}
|
||||
|
||||
return $this->container->get($this->commandMap[$name]);
|
||||
|
||||
Reference in New Issue
Block a user