mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)
Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
@@ -157,7 +157,7 @@ class Application extends BaseApplication
|
||||
return $command;
|
||||
}
|
||||
|
||||
public function all(string $namespace = null): array
|
||||
public function all(?string $namespace = null): array
|
||||
{
|
||||
$this->registerCommands();
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ abstract class Descriptor implements DescriptorInterface
|
||||
*
|
||||
* @param Definition|Alias|object $service
|
||||
*/
|
||||
abstract protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void;
|
||||
abstract protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $container = null): void;
|
||||
|
||||
/**
|
||||
* Describes container services.
|
||||
@@ -108,9 +108,9 @@ abstract class Descriptor implements DescriptorInterface
|
||||
|
||||
abstract protected function describeContainerDeprecations(ContainerBuilder $container, array $options = []): void;
|
||||
|
||||
abstract protected function describeContainerDefinition(Definition $definition, array $options = [], ContainerBuilder $container = null): void;
|
||||
abstract protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void;
|
||||
|
||||
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $container = null): void;
|
||||
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void;
|
||||
|
||||
abstract protected function describeContainerParameter(mixed $parameter, ?array $deprecation, array $options = []): void;
|
||||
|
||||
@@ -278,7 +278,7 @@ abstract class Descriptor implements DescriptorInterface
|
||||
return $reverseAliases;
|
||||
}
|
||||
|
||||
public static function getClassDescription(string $class, string &$resolvedClass = null): string
|
||||
public static function getClassDescription(string $class, ?string &$resolvedClass = null): string
|
||||
{
|
||||
$resolvedClass = $class;
|
||||
try {
|
||||
|
||||
@@ -70,7 +70,7 @@ class JsonDescriptor extends Descriptor
|
||||
$this->writeData($data, $options);
|
||||
}
|
||||
|
||||
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (!isset($options['id'])) {
|
||||
throw new \InvalidArgumentException('An "id" option must be provided.');
|
||||
@@ -121,12 +121,12 @@ class JsonDescriptor extends Descriptor
|
||||
$this->writeData($data, $options);
|
||||
}
|
||||
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
$this->writeData($this->getContainerDefinitionData($definition, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments'], $container, $options['id'] ?? null), $options);
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (!$container) {
|
||||
$this->writeData($this->getContainerAliasData($alias), $options);
|
||||
@@ -245,7 +245,7 @@ class JsonDescriptor extends Descriptor
|
||||
return $sortedParameters;
|
||||
}
|
||||
|
||||
private function getContainerDefinitionData(Definition $definition, bool $omitTags = false, bool $showArguments = false, ContainerBuilder $container = null, string $id = null): array
|
||||
private function getContainerDefinitionData(Definition $definition, bool $omitTags = false, bool $showArguments = false, ?ContainerBuilder $container = null, ?string $id = null): array
|
||||
{
|
||||
$data = [
|
||||
'class' => (string) $definition->getClass(),
|
||||
@@ -393,7 +393,7 @@ class JsonDescriptor extends Descriptor
|
||||
$data['type'] = 'closure';
|
||||
|
||||
$r = new \ReflectionFunction($callable);
|
||||
if (str_contains($r->name, '{closure}')) {
|
||||
if (str_contains($r->name, '{closure')) {
|
||||
return $data;
|
||||
}
|
||||
$data['name'] = $r->name;
|
||||
@@ -418,7 +418,7 @@ class JsonDescriptor extends Descriptor
|
||||
throw new \InvalidArgumentException('Callable is not describable.');
|
||||
}
|
||||
|
||||
private function describeValue($value, bool $omitTags, bool $showArguments, ContainerBuilder $container = null, string $id = null): mixed
|
||||
private function describeValue($value, bool $omitTags, bool $showArguments, ?ContainerBuilder $container = null, ?string $id = null): mixed
|
||||
{
|
||||
if (\is_array($value)) {
|
||||
$data = [];
|
||||
|
||||
@@ -98,7 +98,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
}
|
||||
}
|
||||
|
||||
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (!isset($options['id'])) {
|
||||
throw new \InvalidArgumentException('An "id" option must be provided.');
|
||||
@@ -206,7 +206,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
}
|
||||
}
|
||||
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
$output = '';
|
||||
|
||||
@@ -276,7 +276,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
$this->write(isset($options['id']) ? sprintf("### %s\n\n%s\n", $options['id'], $output) : $output);
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
$output = '- Service: `'.$alias.'`'
|
||||
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');
|
||||
@@ -403,7 +403,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
$string .= "\n- Type: `closure`";
|
||||
|
||||
$r = new \ReflectionFunction($callable);
|
||||
if (str_contains($r->name, '{closure}')) {
|
||||
if (str_contains($r->name, '{closure')) {
|
||||
$this->write($string."\n");
|
||||
|
||||
return;
|
||||
|
||||
@@ -40,7 +40,7 @@ class TextDescriptor extends Descriptor
|
||||
{
|
||||
private ?FileLinkFormatter $fileLinkFormatter;
|
||||
|
||||
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
|
||||
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
|
||||
{
|
||||
$this->fileLinkFormatter = $fileLinkFormatter;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
}
|
||||
|
||||
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (!isset($options['id'])) {
|
||||
throw new \InvalidArgumentException('An "id" option must be provided.');
|
||||
@@ -281,7 +281,7 @@ class TextDescriptor extends Descriptor
|
||||
$options['output']->table($tableHeaders, $tableRows);
|
||||
}
|
||||
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (isset($options['id'])) {
|
||||
$options['output']->title(sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
@@ -420,7 +420,7 @@ class TextDescriptor extends Descriptor
|
||||
$options['output']->listing($formattedLogs);
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if ($alias->isPublic() && !$alias->isPrivate()) {
|
||||
$options['output']->comment(sprintf('This service is a <info>public</info> alias for the service <info>%s</info>', (string) $alias));
|
||||
@@ -579,7 +579,7 @@ class TextDescriptor extends Descriptor
|
||||
return trim($configAsString);
|
||||
}
|
||||
|
||||
private function formatControllerLink(mixed $controller, string $anchorText, callable $getContainer = null): string
|
||||
private function formatControllerLink(mixed $controller, string $anchorText, ?callable $getContainer = null): string
|
||||
{
|
||||
if (null === $this->fileLinkFormatter) {
|
||||
return $anchorText;
|
||||
@@ -597,7 +597,7 @@ class TextDescriptor extends Descriptor
|
||||
} elseif (!\is_string($controller)) {
|
||||
return $anchorText;
|
||||
} elseif (str_contains($controller, '::')) {
|
||||
$r = new \ReflectionMethod($controller);
|
||||
$r = new \ReflectionMethod(...explode('::', $controller, 2));
|
||||
} else {
|
||||
$r = new \ReflectionFunction($controller);
|
||||
}
|
||||
@@ -649,7 +649,7 @@ class TextDescriptor extends Descriptor
|
||||
|
||||
if ($callable instanceof \Closure) {
|
||||
$r = new \ReflectionFunction($callable);
|
||||
if (str_contains($r->name, '{closure}')) {
|
||||
if (str_contains($r->name, '{closure')) {
|
||||
return 'Closure()';
|
||||
}
|
||||
if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
|
||||
|
||||
@@ -53,7 +53,7 @@ class XmlDescriptor extends Descriptor
|
||||
$this->writeDocument($this->getContainerTagsDocument($container, isset($options['show_hidden']) && $options['show_hidden']));
|
||||
}
|
||||
|
||||
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerService(object $service, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
if (!isset($options['id'])) {
|
||||
throw new \InvalidArgumentException('An "id" option must be provided.');
|
||||
@@ -67,12 +67,12 @@ class XmlDescriptor extends Descriptor
|
||||
$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, $options['id'] ?? null));
|
||||
}
|
||||
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
$this->writeDocument($this->getContainerDefinitionDocument($definition, $options['id'] ?? null, isset($options['omit_tags']) && $options['omit_tags'], isset($options['show_arguments']) && $options['show_arguments'], $container));
|
||||
}
|
||||
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $container = null): void
|
||||
protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->appendChild($dom->importNode($this->getContainerAliasDocument($alias, $options['id'] ?? null)->childNodes->item(0), true));
|
||||
@@ -162,7 +162,7 @@ class XmlDescriptor extends Descriptor
|
||||
return $dom;
|
||||
}
|
||||
|
||||
private function getRouteDocument(Route $route, string $name = null): \DOMDocument
|
||||
private function getRouteDocument(Route $route, ?string $name = null): \DOMDocument
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->appendChild($routeXML = $dom->createElement('route'));
|
||||
@@ -268,7 +268,7 @@ class XmlDescriptor extends Descriptor
|
||||
return $dom;
|
||||
}
|
||||
|
||||
private function getContainerServiceDocument(object $service, string $id, ContainerBuilder $container = null, bool $showArguments = false): \DOMDocument
|
||||
private function getContainerServiceDocument(object $service, string $id, ?ContainerBuilder $container = null, bool $showArguments = false): \DOMDocument
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
@@ -288,7 +288,7 @@ class XmlDescriptor extends Descriptor
|
||||
return $dom;
|
||||
}
|
||||
|
||||
private function getContainerServicesDocument(ContainerBuilder $container, string $tag = null, bool $showHidden = false, bool $showArguments = false, callable $filter = null, string $id = null): \DOMDocument
|
||||
private function getContainerServicesDocument(ContainerBuilder $container, ?string $tag = null, bool $showHidden = false, bool $showArguments = false, ?callable $filter = null, ?string $id = null): \DOMDocument
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->appendChild($containerXML = $dom->createElement('container'));
|
||||
@@ -318,7 +318,7 @@ class XmlDescriptor extends Descriptor
|
||||
return $dom;
|
||||
}
|
||||
|
||||
private function getContainerDefinitionDocument(Definition $definition, string $id = null, bool $omitTags = false, bool $showArguments = false, ContainerBuilder $container = null): \DOMDocument
|
||||
private function getContainerDefinitionDocument(Definition $definition, ?string $id = null, bool $omitTags = false, bool $showArguments = false, ?ContainerBuilder $container = null): \DOMDocument
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->appendChild($serviceXML = $dom->createElement('definition'));
|
||||
@@ -418,7 +418,7 @@ class XmlDescriptor extends Descriptor
|
||||
/**
|
||||
* @return \DOMNode[]
|
||||
*/
|
||||
private function getArgumentNodes(array $arguments, \DOMDocument $dom, ContainerBuilder $container = null): array
|
||||
private function getArgumentNodes(array $arguments, \DOMDocument $dom, ?ContainerBuilder $container = null): array
|
||||
{
|
||||
$nodes = [];
|
||||
|
||||
@@ -466,7 +466,7 @@ class XmlDescriptor extends Descriptor
|
||||
return $nodes;
|
||||
}
|
||||
|
||||
private function getContainerAliasDocument(Alias $alias, string $id = null): \DOMDocument
|
||||
private function getContainerAliasDocument(Alias $alias, ?string $id = null): \DOMDocument
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->appendChild($aliasXML = $dom->createElement('alias'));
|
||||
@@ -581,7 +581,7 @@ class XmlDescriptor extends Descriptor
|
||||
$callableXML->setAttribute('type', 'closure');
|
||||
|
||||
$r = new \ReflectionFunction($callable);
|
||||
if (str_contains($r->name, '{closure}')) {
|
||||
if (str_contains($r->name, '{closure')) {
|
||||
return $dom;
|
||||
}
|
||||
$callableXML->setAttribute('name', $r->name);
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
|
||||
*/
|
||||
class DescriptorHelper extends BaseDescriptorHelper
|
||||
{
|
||||
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
|
||||
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
|
||||
{
|
||||
$this
|
||||
->register('txt', new TextDescriptor($fileLinkFormatter))
|
||||
|
||||
Reference in New Issue
Block a user