Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -29,7 +29,7 @@ class AddConsoleCommandPass implements CompilerPassInterface
|
||||
private $commandLoaderServiceId;
|
||||
private $commandTag;
|
||||
|
||||
public function __construct($commandLoaderServiceId = 'console.command_loader', $commandTag = 'console.command')
|
||||
public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command')
|
||||
{
|
||||
$this->commandLoaderServiceId = $commandLoaderServiceId;
|
||||
$this->commandTag = $commandTag;
|
||||
@@ -41,14 +41,11 @@ class AddConsoleCommandPass implements CompilerPassInterface
|
||||
$lazyCommandMap = array();
|
||||
$lazyCommandRefs = array();
|
||||
$serviceIds = array();
|
||||
$lazyServiceIds = array();
|
||||
|
||||
foreach ($commandServices as $id => $tags) {
|
||||
$definition = $container->getDefinition($id);
|
||||
$class = $container->getParameterBag()->resolveValue($definition->getClass());
|
||||
|
||||
$commandId = 'console.command.'.strtolower(str_replace('\\', '_', $class));
|
||||
|
||||
if (isset($tags[0]['command'])) {
|
||||
$commandName = $tags[0]['command'];
|
||||
} else {
|
||||
@@ -62,20 +59,16 @@ class AddConsoleCommandPass implements CompilerPassInterface
|
||||
}
|
||||
|
||||
if (null === $commandName) {
|
||||
if (isset($serviceIds[$commandId]) || $container->hasAlias($commandId)) {
|
||||
$commandId = $commandId.'_'.$id;
|
||||
}
|
||||
if (!$definition->isPublic() || $definition->isPrivate()) {
|
||||
$commandId = 'console.command.public_alias.'.$id;
|
||||
$container->setAlias($commandId, $id)->setPublic(true);
|
||||
$id = $commandId;
|
||||
}
|
||||
$serviceIds[$commandId] = $id;
|
||||
$serviceIds[] = $id;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$serviceIds[$commandId] = $id;
|
||||
$lazyServiceIds[$id] = true;
|
||||
unset($tags[0]);
|
||||
$lazyCommandMap[$commandName] = $id;
|
||||
$lazyCommandRefs[$id] = new TypedReference($id, $class);
|
||||
@@ -101,6 +94,5 @@ class AddConsoleCommandPass implements CompilerPassInterface
|
||||
->setArguments(array(ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap));
|
||||
|
||||
$container->setParameter('console.command.ids', $serviceIds);
|
||||
$container->setParameter('console.lazy_command.ids', $lazyServiceIds);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user