Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -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]);

View File

@@ -21,14 +21,12 @@ use Symfony\Component\Console\Exception\CommandNotFoundException;
*/
class FactoryCommandLoader implements CommandLoaderInterface
{
private array $factories;
/**
* @param callable[] $factories Indexed by command names
*/
public function __construct(array $factories)
{
$this->factories = $factories;
public function __construct(
private array $factories,
) {
}
public function has(string $name): bool
@@ -39,7 +37,7 @@ class FactoryCommandLoader implements CommandLoaderInterface
public function get(string $name): Command
{
if (!isset($this->factories[$name])) {
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
}
$factory = $this->factories[$name];