mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
Re-dump autoloader and composer.lock
This commit is contained in:
@@ -177,7 +177,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
public function getDefaultValue(): mixed
|
||||
{
|
||||
if (!$this->hasDefaultValue()) {
|
||||
throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath()));
|
||||
throw new \RuntimeException(\sprintf('The node at path "%s" has no default value.', $this->getPath()));
|
||||
}
|
||||
|
||||
$defaults = [];
|
||||
@@ -205,7 +205,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
throw new \InvalidArgumentException('Child nodes must be named.');
|
||||
}
|
||||
if (isset($this->children[$name])) {
|
||||
throw new \InvalidArgumentException(sprintf('A child node named "%s" already exists.', $name));
|
||||
throw new \InvalidArgumentException(\sprintf('A child node named "%s" already exists.', $name));
|
||||
}
|
||||
|
||||
$this->children[$name] = $node;
|
||||
@@ -218,15 +218,15 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
protected function finalizeValue(mixed $value): mixed
|
||||
{
|
||||
if (false === $value) {
|
||||
throw new UnsetKeyException(sprintf('Unsetting key for path "%s", value: %s.', $this->getPath(), json_encode($value)));
|
||||
throw new UnsetKeyException(\sprintf('Unsetting key for path "%s", value: %s.', $this->getPath(), json_encode($value)));
|
||||
}
|
||||
|
||||
foreach ($this->children as $name => $child) {
|
||||
if (!\array_key_exists($name, $value)) {
|
||||
if ($child->isRequired()) {
|
||||
$message = sprintf('The child config "%s" under "%s" must be configured', $name, $this->getPath());
|
||||
$message = \sprintf('The child config "%s" under "%s" must be configured', $name, $this->getPath());
|
||||
if ($child->getInfo()) {
|
||||
$message .= sprintf(': %s', $child->getInfo());
|
||||
$message .= \sprintf(': %s', $child->getInfo());
|
||||
} else {
|
||||
$message .= '.';
|
||||
}
|
||||
@@ -264,7 +264,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
protected function validateType(mixed $value)
|
||||
{
|
||||
if (!\is_array($value) && (!$this->allowFalse || false !== $value)) {
|
||||
$ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "array", but got "%s"', $this->getPath(), get_debug_type($value)));
|
||||
$ex = new InvalidTypeException(\sprintf('Invalid type for path "%s". Expected "array", but got "%s"', $this->getPath(), get_debug_type($value)));
|
||||
if ($hint = $this->getInfo()) {
|
||||
$ex->addHint($hint);
|
||||
}
|
||||
@@ -315,13 +315,13 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
}
|
||||
}
|
||||
|
||||
$msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === \count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
|
||||
$msg = \sprintf('Unrecognized option%s "%s" under "%s"', 1 === \count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
|
||||
|
||||
if (\count($guesses)) {
|
||||
asort($guesses);
|
||||
$msg .= sprintf('. Did you mean "%s"?', implode('", "', array_keys($guesses)));
|
||||
$msg .= \sprintf('. Did you mean "%s"?', implode('", "', array_keys($guesses)));
|
||||
} else {
|
||||
$msg .= sprintf('. Available option%s %s "%s".', 1 === \count($proposals) ? '' : 's', 1 === \count($proposals) ? 'is' : 'are', implode('", "', $proposals));
|
||||
$msg .= \sprintf('. Available option%s %s "%s".', 1 === \count($proposals) ? '' : 's', 1 === \count($proposals) ? 'is' : 'are', implode('", "', $proposals));
|
||||
}
|
||||
|
||||
$ex = new InvalidConfigurationException($msg);
|
||||
@@ -370,7 +370,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
// no conflict
|
||||
if (!\array_key_exists($k, $leftSide)) {
|
||||
if (!$this->allowNewKeys) {
|
||||
$ex = new InvalidConfigurationException(sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file. If you are trying to overwrite an element, make sure you redefine it with the same name.', $this->getPath()));
|
||||
$ex = new InvalidConfigurationException(\sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file. If you are trying to overwrite an element, make sure you redefine it with the same name.', $this->getPath()));
|
||||
$ex->setPath($this->getPath());
|
||||
|
||||
throw $ex;
|
||||
|
||||
Reference in New Issue
Block a user