Skip to content

Commit 31ac82b

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: 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 7fadd2d + a29eb60 commit 31ac82b

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
@@ -210,7 +210,7 @@ public function getExtension(string $name)
210210
return $this->extensionsByNs[$name];
211211
}
212212

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

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

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

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

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

Dumper/PhpDumper.php

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

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

10361036
if ($callable[0] instanceof Reference
@@ -1763,7 +1763,7 @@ private function dumpLiteralClass(string $class): string
17631763
return sprintf('${($_ = %s) && false ?: "_"}', $class);
17641764
}
17651765
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)) {
1766-
throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s)', $class ?: 'n/a'));
1766+
throw new RuntimeException(sprintf('Cannot dump definition because of invalid class name (%s).', $class ?: 'n/a'));
17671767
}
17681768

17691769
$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
@@ -31,7 +31,7 @@ public function __call(string $method, array $args)
3131
return $this->{'set'.$method}(...$args);
3232
}
3333

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

3737
/**

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
@@ -395,7 +395,7 @@ private function parseFileToDOM(string $file): \DOMDocument
395395
try {
396396
$dom = XmlUtils::loadFile($file, [$this, 'validateSchema']);
397397
} catch (\InvalidArgumentException $e) {
398-
throw new InvalidArgumentException(sprintf('Unable to parse file "%s": %s', $file, $e->getMessage()), $e->getCode(), $e);
398+
throw new InvalidArgumentException(sprintf('Unable to parse file "%s": %s.', $file, $e->getMessage()), $e->getCode(), $e);
399399
}
400400

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

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

597597
$schemaLocations[$items[$i]] = $path;
@@ -678,7 +678,7 @@ private function validateExtensions(\DOMDocument $dom, string $file)
678678
// can it be handled by an extension?
679679
if (!$this->container->hasExtension($node->namespaceURI)) {
680680
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
681-
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'));
681+
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'));
682682
}
683683
}
684684
}

Loader/YamlFileLoader.php

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

688688
return $this->validate($configuration, $file);
@@ -710,7 +710,7 @@ private function validate($content, string $file): ?array
710710

711711
if (!$this->container->hasExtension($namespace)) {
712712
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
713-
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'));
713+
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'));
714714
}
715715
}
716716

0 commit comments

Comments
 (0)