api/symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.yaml
2024-09-26 02:03:21 -07:00

284 lines
20 KiB
YAML

name: XmlDescriptor
class_comment: "# * @author Jean-Fran\xE7ois Simon <jeanfrancois.simon@sensiolabs.com>\n\
# *\n# * @internal"
dependencies:
- name: LogicException
type: class
source: Symfony\Component\Console\Exception\LogicException
- name: RuntimeException
type: class
source: Symfony\Component\Console\Exception\RuntimeException
- name: Alias
type: class
source: Symfony\Component\DependencyInjection\Alias
- name: AbstractArgument
type: class
source: Symfony\Component\DependencyInjection\Argument\AbstractArgument
- name: IteratorArgument
type: class
source: Symfony\Component\DependencyInjection\Argument\IteratorArgument
- name: ServiceClosureArgument
type: class
source: Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument
- name: ServiceLocatorArgument
type: class
source: Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument
- name: ContainerBuilder
type: class
source: Symfony\Component\DependencyInjection\ContainerBuilder
- name: Definition
type: class
source: Symfony\Component\DependencyInjection\Definition
- name: ParameterBag
type: class
source: Symfony\Component\DependencyInjection\ParameterBag\ParameterBag
- name: Reference
type: class
source: Symfony\Component\DependencyInjection\Reference
- name: EventDispatcherInterface
type: class
source: Symfony\Component\EventDispatcher\EventDispatcherInterface
- name: Route
type: class
source: Symfony\Component\Routing\Route
- name: RouteCollection
type: class
source: Symfony\Component\Routing\RouteCollection
properties: []
methods:
- name: getArgumentNodes
visibility: private
parameters:
- name: arguments
- name: dom
- name: container
default: 'null'
comment: "# * @author Jean-Fran\xE7ois Simon <jeanfrancois.simon@sensiolabs.com>\n\
# *\n# * @internal\n# */\n# class XmlDescriptor extends Descriptor\n# {\n# protected\
\ function describeRouteCollection(RouteCollection $routes, array $options = []):\
\ void\n# {\n# $this->writeDocument($this->getRouteCollectionDocument($routes,\
\ $options));\n# }\n# \n# protected function describeRoute(Route $route, array\
\ $options = []): void\n# {\n# $this->writeDocument($this->getRouteDocument($route,\
\ $options['name'] ?? null));\n# }\n# \n# protected function describeContainerParameters(ParameterBag\
\ $parameters, array $options = []): void\n# {\n# $this->writeDocument($this->getContainerParametersDocument($parameters));\n\
# }\n# \n# protected function describeContainerTags(ContainerBuilder $container,\
\ array $options = []): void\n# {\n# $this->writeDocument($this->getContainerTagsDocument($container,\
\ isset($options['show_hidden']) && $options['show_hidden']));\n# }\n# \n# protected\
\ function describeContainerService(object $service, array $options = [], ?ContainerBuilder\
\ $container = null): void\n# {\n# if (!isset($options['id'])) {\n# throw new\
\ \\InvalidArgumentException('An \"id\" option must be provided.');\n# }\n# \n\
# $this->writeDocument($this->getContainerServiceDocument($service, $options['id'],\
\ $container, isset($options['show_arguments']) && $options['show_arguments']));\n\
# }\n# \n# protected function describeContainerServices(ContainerBuilder $container,\
\ array $options = []): void\n# {\n# $this->writeDocument($this->getContainerServicesDocument($container,\
\ $options['tag'] ?? null, isset($options['show_hidden']) && $options['show_hidden'],\
\ isset($options['show_arguments']) && $options['show_arguments'], $options['filter']\
\ ?? null));\n# }\n# \n# protected function describeContainerDefinition(Definition\
\ $definition, array $options = [], ?ContainerBuilder $container = null): void\n\
# {\n# $this->writeDocument($this->getContainerDefinitionDocument($definition,\
\ $options['id'] ?? null, isset($options['omit_tags']) && $options['omit_tags'],\
\ isset($options['show_arguments']) && $options['show_arguments'], $container));\n\
# }\n# \n# protected function describeContainerAlias(Alias $alias, array $options\
\ = [], ?ContainerBuilder $container = null): void\n# {\n# $dom = new \\DOMDocument('1.0',\
\ 'UTF-8');\n# $dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias,\
\ $options['id'] ?? null)->childNodes->item(0), true));\n# \n# if (!$container)\
\ {\n# $this->writeDocument($dom);\n# \n# return;\n# }\n# \n# $dom->appendChild($dom->importNode($this->getContainerDefinitionDocument($container->getDefinition((string)\
\ $alias), (string) $alias, false, false, $container)->childNodes->item(0), true));\n\
# \n# $this->writeDocument($dom);\n# }\n# \n# protected function describeEventDispatcherListeners(EventDispatcherInterface\
\ $eventDispatcher, array $options = []): void\n# {\n# $this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher,\
\ $options));\n# }\n# \n# protected function describeCallable(mixed $callable,\
\ array $options = []): void\n# {\n# $this->writeDocument($this->getCallableDocument($callable));\n\
# }\n# \n# protected function describeContainerParameter(mixed $parameter, ?array\
\ $deprecation, array $options = []): void\n# {\n# $this->writeDocument($this->getContainerParameterDocument($parameter,\
\ $deprecation, $options));\n# }\n# \n# protected function describeContainerEnvVars(array\
\ $envs, array $options = []): void\n# {\n# throw new LogicException('Using the\
\ XML format to debug environment variables is not supported.');\n# }\n# \n# protected\
\ function describeContainerDeprecations(ContainerBuilder $container, array $options\
\ = []): void\n# {\n# $containerDeprecationFilePath = \\sprintf('%s/%sDeprecations.log',\
\ $container->getParameter('kernel.build_dir'), $container->getParameter('kernel.container_class'));\n\
# if (!file_exists($containerDeprecationFilePath)) {\n# throw new RuntimeException('The\
\ deprecation file does not exist, please try warming the cache first.');\n# }\n\
# \n# $logs = unserialize(file_get_contents($containerDeprecationFilePath));\n\
# \n# $dom = new \\DOMDocument('1.0', 'UTF-8');\n# $dom->appendChild($deprecationsXML\
\ = $dom->createElement('deprecations'));\n# \n# $remainingCount = 0;\n# foreach\
\ ($logs as $log) {\n# $deprecationsXML->appendChild($deprecationXML = $dom->createElement('deprecation'));\n\
# $deprecationXML->setAttribute('count', $log['count']);\n# $deprecationXML->appendChild($dom->createElement('message',\
\ $log['message']));\n# $deprecationXML->appendChild($dom->createElement('file',\
\ $log['file']));\n# $deprecationXML->appendChild($dom->createElement('line',\
\ $log['line']));\n# $remainingCount += $log['count'];\n# }\n# \n# $deprecationsXML->setAttribute('remainingCount',\
\ $remainingCount);\n# \n# $this->writeDocument($dom);\n# }\n# \n# private function\
\ writeDocument(\\DOMDocument $dom): void\n# {\n# $dom->formatOutput = true;\n\
# $this->write($dom->saveXML());\n# }\n# \n# private function getRouteCollectionDocument(RouteCollection\
\ $routes, array $options): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0',\
\ 'UTF-8');\n# $dom->appendChild($routesXML = $dom->createElement('routes'));\n\
# \n# foreach ($routes->all() as $name => $route) {\n# $routeXML = $this->getRouteDocument($route,\
\ $name);\n# if (($showAliases ??= $options['show_aliases'] ?? false) && $aliases\
\ = ($reverseAliases ??= $this->getReverseAliases($routes))[$name] ?? []) {\n\
# $routeXML->firstChild->appendChild($aliasesXML = $routeXML->createElement('aliases'));\n\
# foreach ($aliases as $alias) {\n# $aliasesXML->appendChild($aliasXML = $routeXML->createElement('alias'));\n\
# $aliasXML->appendChild(new \\DOMText($alias));\n# }\n# }\n# \n# $routesXML->appendChild($routesXML->ownerDocument->importNode($routeXML->childNodes->item(0),\
\ true));\n# }\n# \n# return $dom;\n# }\n# \n# private function getRouteDocument(Route\
\ $route, ?string $name = null): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0',\
\ 'UTF-8');\n# $dom->appendChild($routeXML = $dom->createElement('route'));\n\
# \n# if ($name) {\n# $routeXML->setAttribute('name', $name);\n# }\n# \n# $routeXML->setAttribute('class',\
\ $route::class);\n# \n# $routeXML->appendChild($pathXML = $dom->createElement('path'));\n\
# $pathXML->setAttribute('regex', $route->compile()->getRegex());\n# $pathXML->appendChild(new\
\ \\DOMText($route->getPath()));\n# \n# if ('' !== $route->getHost()) {\n# $routeXML->appendChild($hostXML\
\ = $dom->createElement('host'));\n# $hostXML->setAttribute('regex', $route->compile()->getHostRegex());\n\
# $hostXML->appendChild(new \\DOMText($route->getHost()));\n# }\n# \n# foreach\
\ ($route->getSchemes() as $scheme) {\n# $routeXML->appendChild($schemeXML = $dom->createElement('scheme'));\n\
# $schemeXML->appendChild(new \\DOMText($scheme));\n# }\n# \n# foreach ($route->getMethods()\
\ as $method) {\n# $routeXML->appendChild($methodXML = $dom->createElement('method'));\n\
# $methodXML->appendChild(new \\DOMText($method));\n# }\n# \n# if ($route->getDefaults())\
\ {\n# $routeXML->appendChild($defaultsXML = $dom->createElement('defaults'));\n\
# foreach ($route->getDefaults() as $attribute => $value) {\n# $defaultsXML->appendChild($defaultXML\
\ = $dom->createElement('default'));\n# $defaultXML->setAttribute('key', $attribute);\n\
# $defaultXML->appendChild(new \\DOMText($this->formatValue($value)));\n# }\n\
# }\n# \n# $originRequirements = $requirements = $route->getRequirements();\n\
# unset($requirements['_scheme'], $requirements['_method']);\n# if ($requirements)\
\ {\n# $routeXML->appendChild($requirementsXML = $dom->createElement('requirements'));\n\
# foreach ($originRequirements as $attribute => $pattern) {\n# $requirementsXML->appendChild($requirementXML\
\ = $dom->createElement('requirement'));\n# $requirementXML->setAttribute('key',\
\ $attribute);\n# $requirementXML->appendChild(new \\DOMText($pattern));\n# }\n\
# }\n# \n# if ($route->getOptions()) {\n# $routeXML->appendChild($optionsXML =\
\ $dom->createElement('options'));\n# foreach ($route->getOptions() as $name =>\
\ $value) {\n# $optionsXML->appendChild($optionXML = $dom->createElement('option'));\n\
# $optionXML->setAttribute('key', $name);\n# $optionXML->appendChild(new \\DOMText($this->formatValue($value)));\n\
# }\n# }\n# \n# if ('' !== $route->getCondition()) {\n# $routeXML->appendChild($conditionXML\
\ = $dom->createElement('condition'));\n# $conditionXML->appendChild(new \\DOMText($route->getCondition()));\n\
# }\n# \n# return $dom;\n# }\n# \n# private function getContainerParametersDocument(ParameterBag\
\ $parameters): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0', 'UTF-8');\n\
# $dom->appendChild($parametersXML = $dom->createElement('parameters'));\n# \n\
# $deprecatedParameters = $parameters->allDeprecated();\n# \n# foreach ($this->sortParameters($parameters)\
\ as $key => $value) {\n# $parametersXML->appendChild($parameterXML = $dom->createElement('parameter'));\n\
# $parameterXML->setAttribute('key', $key);\n# $parameterXML->appendChild(new\
\ \\DOMText($this->formatParameter($value)));\n# \n# if (isset($deprecatedParameters[$key]))\
\ {\n# $parameterXML->setAttribute('deprecated', \\sprintf('Since %s %s: %s',\
\ $deprecatedParameters[$key][0], $deprecatedParameters[$key][1], \\sprintf(...\\\
array_slice($deprecatedParameters[$key], 2))));\n# }\n# }\n# \n# return $dom;\n\
# }\n# \n# private function getContainerTagsDocument(ContainerBuilder $container,\
\ bool $showHidden = false): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0',\
\ 'UTF-8');\n# $dom->appendChild($containerXML = $dom->createElement('container'));\n\
# \n# foreach ($this->findDefinitionsByTag($container, $showHidden) as $tag =>\
\ $definitions) {\n# $containerXML->appendChild($tagXML = $dom->createElement('tag'));\n\
# $tagXML->setAttribute('name', $tag);\n# \n# foreach ($definitions as $serviceId\
\ => $definition) {\n# $definitionXML = $this->getContainerDefinitionDocument($definition,\
\ $serviceId, true, false, $container);\n# $tagXML->appendChild($dom->importNode($definitionXML->childNodes->item(0),\
\ true));\n# }\n# }\n# \n# return $dom;\n# }\n# \n# private function getContainerServiceDocument(object\
\ $service, string $id, ?ContainerBuilder $container = null, bool $showArguments\
\ = false): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0', 'UTF-8');\n\
# \n# if ($service instanceof Alias) {\n# $dom->appendChild($dom->importNode($this->getContainerAliasDocument($service,\
\ $id)->childNodes->item(0), true));\n# if ($container) {\n# $dom->appendChild($dom->importNode($this->getContainerDefinitionDocument($container->getDefinition((string)\
\ $service), (string) $service, false, $showArguments, $container)->childNodes->item(0),\
\ true));\n# }\n# } elseif ($service instanceof Definition) {\n# $dom->appendChild($dom->importNode($this->getContainerDefinitionDocument($service,\
\ $id, false, $showArguments, $container)->childNodes->item(0), true));\n# } else\
\ {\n# $dom->appendChild($serviceXML = $dom->createElement('service'));\n# $serviceXML->setAttribute('id',\
\ $id);\n# $serviceXML->setAttribute('class', $service::class);\n# }\n# \n# return\
\ $dom;\n# }\n# \n# private function getContainerServicesDocument(ContainerBuilder\
\ $container, ?string $tag = null, bool $showHidden = false, bool $showArguments\
\ = false, ?callable $filter = null): \\DOMDocument\n# {\n# $dom = new \\DOMDocument('1.0',\
\ 'UTF-8');\n# $dom->appendChild($containerXML = $dom->createElement('container'));\n\
# \n# $serviceIds = $tag\n# ? $this->sortTaggedServicesByPriority($container->findTaggedServiceIds($tag))\n\
# : $this->sortServiceIds($container->getServiceIds());\n# if ($filter) {\n# $serviceIds\
\ = array_filter($serviceIds, $filter);\n# }\n# \n# foreach ($serviceIds as $serviceId)\
\ {\n# $service = $this->resolveServiceDefinition($container, $serviceId);\n#\
\ \n# if ($showHidden xor '.' === ($serviceId[0] ?? null)) {\n# continue;\n# }\n\
# \n# if ($service instanceof Definition && $service->hasTag('container.excluded'))\
\ {\n# continue;\n# }\n# \n# $serviceXML = $this->getContainerServiceDocument($service,\
\ $serviceId, null, $showArguments);\n# $containerXML->appendChild($containerXML->ownerDocument->importNode($serviceXML->childNodes->item(0),\
\ true));\n# }\n# \n# return $dom;\n# }\n# \n# private function getContainerDefinitionDocument(Definition\
\ $definition, ?string $id = null, bool $omitTags = false, bool $showArguments\
\ = false, ?ContainerBuilder $container = null): \\DOMDocument\n# {\n# $dom =\
\ new \\DOMDocument('1.0', 'UTF-8');\n# $dom->appendChild($serviceXML = $dom->createElement('definition'));\n\
# \n# if ($id) {\n# $serviceXML->setAttribute('id', $id);\n# }\n# \n# if ('' !==\
\ $classDescription = $this->getClassDescription((string) $definition->getClass()))\
\ {\n# $serviceXML->appendChild($descriptionXML = $dom->createElement('description'));\n\
# $descriptionXML->appendChild($dom->createCDATASection($classDescription));\n\
# }\n# \n# $serviceXML->setAttribute('class', $definition->getClass() ?? '');\n\
# \n# if ($factory = $definition->getFactory()) {\n# $serviceXML->appendChild($factoryXML\
\ = $dom->createElement('factory'));\n# \n# if (\\is_array($factory)) {\n# if\
\ ($factory[0] instanceof Reference) {\n# $factoryXML->setAttribute('service',\
\ (string) $factory[0]);\n# } elseif ($factory[0] instanceof Definition) {\n#\
\ $factoryXML->setAttribute('service', \\sprintf('inline factory service (%s)',\
\ $factory[0]->getClass() ?? 'not configured'));\n# } else {\n# $factoryXML->setAttribute('class',\
\ $factory[0]);\n# }\n# $factoryXML->setAttribute('method', $factory[1]);\n# }\
\ else {\n# $factoryXML->setAttribute('function', $factory);\n# }\n# }\n# \n#\
\ $serviceXML->setAttribute('public', $definition->isPublic() && !$definition->isPrivate()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('synthetic', $definition->isSynthetic()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('lazy', $definition->isLazy()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('shared', $definition->isShared()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('abstract', $definition->isAbstract()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('autowired', $definition->isAutowired()\
\ ? 'true' : 'false');\n# $serviceXML->setAttribute('autoconfigured', $definition->isAutoconfigured()\
\ ? 'true' : 'false');\n# if ($definition->isDeprecated()) {\n# $serviceXML->setAttribute('deprecated',\
\ 'true');\n# $serviceXML->setAttribute('deprecation_message', $definition->getDeprecation($id)['message']);\n\
# } else {\n# $serviceXML->setAttribute('deprecated', 'false');\n# }\n# $serviceXML->setAttribute('file',\
\ $definition->getFile() ?? '');\n# \n# $calls = $definition->getMethodCalls();\n\
# if (\\count($calls) > 0) {\n# $serviceXML->appendChild($callsXML = $dom->createElement('calls'));\n\
# foreach ($calls as $callData) {\n# $callsXML->appendChild($callXML = $dom->createElement('call'));\n\
# $callXML->setAttribute('method', $callData[0]);\n# if ($callData[2] ?? false)\
\ {\n# $callXML->setAttribute('returns-clone', 'true');\n# }\n# }\n# }\n# \n#\
\ if ($showArguments) {\n# foreach ($this->getArgumentNodes($definition->getArguments(),\
\ $dom, $container) as $node) {\n# $serviceXML->appendChild($node);\n# }\n# }\n\
# \n# if (!$omitTags) {\n# if ($tags = $this->sortTagsByPriority($definition->getTags()))\
\ {\n# $serviceXML->appendChild($tagsXML = $dom->createElement('tags'));\n# foreach\
\ ($tags as $tagName => $tagData) {\n# foreach ($tagData as $parameters) {\n#\
\ $tagsXML->appendChild($tagXML = $dom->createElement('tag'));\n# $tagXML->setAttribute('name',\
\ $tagName);\n# foreach ($parameters as $name => $value) {\n# $tagXML->appendChild($parameterXML\
\ = $dom->createElement('parameter'));\n# $parameterXML->setAttribute('name',\
\ $name);\n# $parameterXML->appendChild(new \\DOMText($this->formatParameter($value)));\n\
# }\n# }\n# }\n# }\n# }\n# \n# if (null !== $container && null !== $id) {\n# $edges\
\ = $this->getServiceEdges($container, $id);\n# if ($edges) {\n# $serviceXML->appendChild($usagesXML\
\ = $dom->createElement('usages'));\n# foreach ($edges as $edge) {\n# $usagesXML->appendChild($usageXML\
\ = $dom->createElement('usage'));\n# $usageXML->appendChild(new \\DOMText($edge));\n\
# }\n# }\n# }\n# \n# return $dom;\n# }\n# \n# /**\n# * @return \\DOMNode[]"
- name: getContainerAliasDocument
visibility: private
parameters:
- name: alias
- name: id
default: 'null'
comment: null
- name: getContainerParameterDocument
visibility: private
parameters:
- name: parameter
- name: deprecation
- name: options
default: '[]'
comment: null
- name: getEventDispatcherListenersDocument
visibility: private
parameters:
- name: eventDispatcher
- name: options
comment: null
- name: appendEventListenerDocument
visibility: private
parameters:
- name: eventDispatcher
- name: event
- name: element
- name: eventListeners
comment: null
- name: getCallableDocument
visibility: private
parameters:
- name: callable
comment: null
traits:
- Symfony\Component\Console\Exception\LogicException
- Symfony\Component\Console\Exception\RuntimeException
- Symfony\Component\DependencyInjection\Alias
- Symfony\Component\DependencyInjection\Argument\AbstractArgument
- Symfony\Component\DependencyInjection\Argument\IteratorArgument
- Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument
- Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument
- Symfony\Component\DependencyInjection\ContainerBuilder
- Symfony\Component\DependencyInjection\Definition
- Symfony\Component\DependencyInjection\ParameterBag\ParameterBag
- Symfony\Component\DependencyInjection\Reference
- Symfony\Component\EventDispatcher\EventDispatcherInterface
- Symfony\Component\Routing\Route
- Symfony\Component\Routing\RouteCollection
interfaces: []