Skip to content

Commit 8245b6b

Browse files
committed
Merge branch '5.0'
* 5.0: Add missing dots at the end of exception messages Add missing dots at the end of exception messages [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict) Fix bad merge Add missing dots at the end of exception messages
2 parents c7f8ca9 + 31ac82b commit 8245b6b

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

ContainerBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function getExtension(string $name)
211211
return $this->extensionsByNs[$name];
212212
}
213213

214-
throw new LogicException(sprintf('Container extension "%s" is not registered', $name));
214+
throw new LogicException(sprintf('Container extension "%s" is not registered.', $name));
215215
}
216216

217217
/**
@@ -810,7 +810,7 @@ public function setAliases(array $aliases)
810810
public function setAlias(string $alias, $id)
811811
{
812812
if ('' === $alias || '\\' === $alias[-1] || \strlen($alias) !== strcspn($alias, "\0\r\n'")) {
813-
throw new InvalidArgumentException(sprintf('Invalid alias id: "%s"', $alias));
813+
throw new InvalidArgumentException(sprintf('Invalid alias id: "%s".', $alias));
814814
}
815815

816816
if (\is_string($id)) {
@@ -946,11 +946,11 @@ public function getDefinitions()
946946
public function setDefinition(string $id, Definition $definition)
947947
{
948948
if ($this->isCompiled()) {
949-
throw new BadMethodCallException('Adding definition to a compiled container is not allowed');
949+
throw new BadMethodCallException('Adding definition to a compiled container is not allowed.');
950950
}
951951

952952
if ('' === $id || '\\' === $id[-1] || \strlen($id) !== strcspn($id, "\0\r\n'")) {
953-
throw new InvalidArgumentException(sprintf('Invalid service id: "%s"', $id));
953+
throw new InvalidArgumentException(sprintf('Invalid service id: "%s".', $id));
954954
}
955955

956956
unset($this->aliasDefinitions[$id], $this->removedIds[$id]);
@@ -1065,7 +1065,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10651065
if (\is_array($factory)) {
10661066
$factory = [$this->doResolveServices($parameterBag->resolveValue($factory[0]), $inlineServices, $isConstructorArgument), $factory[1]];
10671067
} elseif (!\is_string($factory)) {
1068-
throw new RuntimeException(sprintf('Cannot create service "%s" because of invalid factory', $id));
1068+
throw new RuntimeException(sprintf('Cannot create service "%s" because of invalid factory.', $id));
10691069
}
10701070
}
10711071

Dumper/PhpDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ private function addNewInstance(Definition $definition, string $return = '', str
10311031

10321032
if (\is_array($callable)) {
10331033
if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $callable[1])) {
1034-
throw new RuntimeException(sprintf('Cannot dump definition because of invalid factory method (%s)', $callable[1] ?: 'n/a'));
1034+
throw new RuntimeException(sprintf('Cannot dump definition because of invalid factory method (%s).', $callable[1] ?: 'n/a'));
10351035
}
10361036

10371037
if ($callable[0] instanceof Reference
@@ -1766,7 +1766,7 @@ private function dumpLiteralClass(string $class): string
17661766
return sprintf('${($_ = %s) && false ?: "_"}', $class);
17671767
}
17681768
if (0 !== strpos($class, "'") || !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) {
1769-
throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s)', $class ?: 'n/a'));
1769+
throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s).', $class ?: 'n/a'));
17701770
}
17711771

17721772
$class = substr(str_replace('\\\\', '\\', $class), 1, -1);

EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv)
241241
$parsedEnv = parse_url($env);
242242

243243
if (false === $parsedEnv) {
244-
throw new RuntimeException(sprintf('Invalid URL in env var "%s"', $name));
244+
throw new RuntimeException(sprintf('Invalid URL in env var "%s".', $name));
245245
}
246246
if (!isset($parsedEnv['scheme'], $parsedEnv['host'])) {
247247
throw new RuntimeException(sprintf('Invalid URL env var "%s": schema and host expected, %s given.', $name, $env));

Loader/Configurator/AbstractConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __call(string $method, array $args)
3636
return $this->{'set'.$method}(...$args);
3737
}
3838

39-
throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', static::class, $method));
39+
throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s().', static::class, $method));
4040
}
4141

4242
/**

Loader/Configurator/ContainerConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final public function extension(string $namespace, array $config)
4848
{
4949
if (!$this->container->hasExtension($namespace)) {
5050
$extensions = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
51-
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, $this->file, $namespace, $extensions ? sprintf('"%s"', implode('", "', $extensions)) : 'none'));
51+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s.', $namespace, $this->file, $namespace, $extensions ? sprintf('"%s"', implode('", "', $extensions)) : 'none'));
5252
}
5353

5454
$this->container->loadFromExtension($namespace, static::processValue($config));

Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private function findClasses(string $namespace, string $pattern, array $excludeP
178178
$prefixLen = \strlen($resource->getPrefix());
179179

180180
if ($excludePrefix && 0 !== strpos($excludePrefix, $resource->getPrefix())) {
181-
throw new InvalidArgumentException(sprintf('Invalid "exclude" pattern when importing classes for "%s": make sure your "exclude" pattern (%s) is a subset of the "resource" pattern (%s)', $namespace, $excludePattern, $pattern));
181+
throw new InvalidArgumentException(sprintf('Invalid "exclude" pattern when importing classes for "%s": make sure your "exclude" pattern (%s) is a subset of the "resource" pattern (%s).', $namespace, $excludePattern, $pattern));
182182
}
183183
}
184184

Loader/XmlFileLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private function parseFileToDOM(string $file): \DOMDocument
396396
try {
397397
$dom = XmlUtils::loadFile($file, [$this, 'validateSchema']);
398398
} catch (\InvalidArgumentException $e) {
399-
throw new InvalidArgumentException(sprintf('Unable to parse file "%s": %s', $file, $e->getMessage()), $e->getCode(), $e);
399+
throw new InvalidArgumentException(sprintf('Unable to parse file "%s": %s.', $file, $e->getMessage()), $e->getCode(), $e);
400400
}
401401

402402
$this->validateExtensions($dom, $file);
@@ -596,7 +596,7 @@ public function validateSchema(\DOMDocument $dom)
596596
$path = str_replace([$ns, str_replace('http://', 'https://', $ns)], str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]);
597597

598598
if (!is_file($path)) {
599-
throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s"', \get_class($extension), $path));
599+
throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s".', \get_class($extension), $path));
600600
}
601601

602602
$schemaLocations[$items[$i]] = $path;
@@ -683,7 +683,7 @@ private function validateExtensions(\DOMDocument $dom, string $file)
683683
// can it be handled by an extension?
684684
if (!$this->container->hasExtension($node->namespaceURI)) {
685685
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
686-
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $node->tagName, $file, $node->namespaceURI, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
686+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s.', $node->tagName, $file, $node->namespaceURI, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
687687
}
688688
}
689689
}

Loader/YamlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ protected function loadFile($file)
683683
try {
684684
$configuration = $this->yamlParser->parseFile($file, Yaml::PARSE_CONSTANT | Yaml::PARSE_CUSTOM_TAGS);
685685
} catch (ParseException $e) {
686-
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: %s', $file, $e->getMessage()), 0, $e);
686+
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: %s.', $file, $e->getMessage()), 0, $e);
687687
}
688688

689689
return $this->validate($configuration, $file);
@@ -711,7 +711,7 @@ private function validate($content, string $file): ?array
711711

712712
if (!$this->container->hasExtension($namespace)) {
713713
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
714-
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, $file, $namespace, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
714+
throw new InvalidArgumentException(sprintf('There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s.', $namespace, $file, $namespace, $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none'));
715715
}
716716
}
717717

0 commit comments

Comments
 (0)