describeContainerAlias example

match (true) {
            $object instanceof RouteCollection => $this->describeRouteCollection($object$options),
            $object instanceof Route => $this->describeRoute($object$options),
            $object instanceof ParameterBag => $this->describeContainerParameters($object$options),
            $object instanceof ContainerBuilder && !empty($options['env-vars']) => $this->describeContainerEnvVars($this->getContainerEnvVars($object)$options),
            $object instanceof ContainerBuilder && isset($options['group_by']) && 'tags' === $options['group_by'] => $this->describeContainerTags($object$options),
            $object instanceof ContainerBuilder && isset($options['id']) => $this->describeContainerService($this->resolveServiceDefinition($object$options['id'])$options$object),
            $object instanceof ContainerBuilder && isset($options['parameter']) => $this->describeContainerParameter($object->resolveEnvPlaceholders($object->getParameter($options['parameter']))$options),
            $object instanceof ContainerBuilder && isset($options['deprecations']) => $this->describeContainerDeprecations($object$options),
            $object instanceof ContainerBuilder => $this->describeContainerServices($object$options),
            $object instanceof Definition => $this->describeContainerDefinition($object$options),
            $object instanceof Alias => $this->describeContainerAlias($object$options),
            $object instanceof EventDispatcherInterface => $this->describeEventDispatcherListeners($object$options),
            \is_callable($object) => $this->describeCallable($object$options),
            default => throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
        };

        if ($object instanceof ContainerBuilder) {
            $object->getCompiler()->getServiceReferenceGraph()->clear();
        }
    }

    protected function getOutput(): OutputInterface
    {
$options['output']->listing(array_keys($definitions));
        }
    }

    protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
    {
        if (!isset($options['id'])) {
            throw new \InvalidArgumentException('An "id" option must be provided.');
        }

        if ($service instanceof Alias) {
            $this->describeContainerAlias($service$options$container);
        } elseif ($service instanceof Definition) {
            $this->describeContainerDefinition($service$options$container);
        } else {
            $options['output']->title(sprintf('Information for Service "<info>%s</info>"', $options['id']));
            $options['output']->table(
                ['Service ID', 'Class'],
                [
                    [$options['id'] ?? '-', $service::class],
                ]
            );
        }
    }


    protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
    {
        if (!isset($options['id'])) {
            throw new \InvalidArgumentException('An "id" option must be provided.');
        }

        $childOptions = array_merge($options['id' => $options['id'], 'as_array' => true]);

        if ($service instanceof Alias) {
            $this->describeContainerAlias($service$childOptions$container);
        } elseif ($service instanceof Definition) {
            $this->describeContainerDefinition($service$childOptions$container);
        } else {
            $this->write(sprintf('**`%s`:** `%s`', $options['id']$service::class));
        }
    }

    protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void
    {
        $containerDeprecationFilePath = sprintf('%s/%sDeprecations.log', $container->getParameter('kernel.build_dir')$container->getParameter('kernel.container_class'));
        if (!file_exists($containerDeprecationFilePath)) {
            
$this->writeData($data$options);
    }

    protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
    {
        if (!isset($options['id'])) {
            throw new \InvalidArgumentException('An "id" option must be provided.');
        }

        if ($service instanceof Alias) {
            $this->describeContainerAlias($service$options$container);
        } elseif ($service instanceof Definition) {
            $this->writeData($this->getContainerDefinitionData($serviceisset($options['omit_tags']) && $options['omit_tags']isset($options['show_arguments']) && $options['show_arguments']$container$options['id'])$options);
        } else {
            $this->writeData($service::class$options);
        }
    }

    protected function describeContainerServices(ContainerBuilder $container, array $options = []): void
    {
        $serviceIds = isset($options['tag']) && $options['tag']
            ? $this->sortTaggedServicesByPriority($container->findTaggedServiceIds($options['tag']))
            :
Home | Imprint | This part of the site doesn't use cookies.