Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14f2d22

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add missing dots at the end of exception messages
2 parents 8848de5 + 13ea421 commit 14f2d22

File tree

163 files changed

+284
-279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+284
-279
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private function addTaggedSubscribers(ContainerBuilder $container)
6969
$connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections);
7070
foreach ($connections as $con) {
7171
if (!isset($this->connections[$con])) {
72-
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections))));
72+
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s.', $con, $id, implode(', ', array_keys($this->connections))));
7373
}
7474

7575
$this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', [new Reference($id)]);
@@ -92,7 +92,7 @@ private function addTaggedListeners(ContainerBuilder $container)
9292
$connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections);
9393
foreach ($connections as $con) {
9494
if (!isset($this->connections[$con])) {
95-
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections))));
95+
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s.', $con, $id, implode(', ', array_keys($this->connections))));
9696
}
9797
$listenerRefs[$con][$id] = new Reference($id);
9898

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function __construct($driver, array $namespaces, array $managerParameters
125125
$this->driverPattern = $driverPattern;
126126
$this->enabledParameter = $enabledParameter;
127127
if (\count($aliasMap) && (!$configurationPattern || !$registerAliasMethodName)) {
128-
throw new \InvalidArgumentException('configurationPattern and registerAliasMethodName are required to register namespace alias');
128+
throw new \InvalidArgumentException('configurationPattern and registerAliasMethodName are required to register namespace alias.');
129129
}
130130
$this->configurationPattern = $configurationPattern;
131131
$this->registerAliasMethodName = $registerAliasMethodName;
@@ -218,7 +218,7 @@ private function getManagerName(ContainerBuilder $container): string
218218
}
219219
}
220220

221-
throw new InvalidArgumentException(sprintf('Could not find the manager name parameter in the container. Tried the following parameter names: "%s"', implode('", "', $this->managerParameters)));
221+
throw new InvalidArgumentException(sprintf('Could not find the manager name parameter in the container. Tried the following parameter names: "%s".', implode('", "', $this->managerParameters)));
222222
}
223223

224224
/**

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function refreshUser(UserInterface $user)
9292

9393
$refreshedUser = $repository->find($id);
9494
if (null === $refreshedUser) {
95-
throw new UsernameNotFoundException(sprintf('User with id %s not found', json_encode($id)));
95+
throw new UsernameNotFoundException(sprintf('User with id %s not found.', json_encode($id)));
9696
}
9797
}
9898

src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function flushMemorySpool()
8585
}
8686

8787
if (null === $this->transport) {
88-
throw new \Exception('No transport available to flush mail queue');
88+
throw new \Exception('No transport available to flush mail queue.');
8989
}
9090

9191
$spool->flushQueue($this->transport);

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function generate(\ReflectionClass $originalClass, ClassGenerator $classG
8888
$newBody = preg_replace('/^(\$this->initializer[a-zA-Z0-9]++) && .*;\n\nreturn (\$this->valueHolder)/', '$1 || $2', $body);
8989

9090
if ($body === $newBody) {
91-
throw new \UnexpectedValueException(sprintf('Unexpected lazy-proxy format generated for method %s::__destruct()', $originalClass->name));
91+
throw new \UnexpectedValueException(sprintf('Unexpected lazy-proxy format generated for method %s::__destruct().', $originalClass->name));
9292
}
9393

9494
$destructor->setBody($newBody);

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private function getMetadata(string $type, $entity)
331331
} elseif (\is_string($cb) && preg_match('{^(.+)::(.+)$}', $cb, $m) && method_exists($m[1], $m[2])) {
332332
$refl = new \ReflectionMethod($m[1], $m[2]);
333333
} else {
334-
throw new \UnexpectedValueException('Unsupported callback type');
334+
throw new \UnexpectedValueException('Unsupported callback type.');
335335
}
336336

337337
$args = $refl->getParameters();

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function findFiles($filename)
152152
return Finder::create()->files()->in($filename)->name('*.twig');
153153
}
154154

155-
throw new RuntimeException(sprintf('File or directory "%s" is not readable', $filename));
155+
throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
156156
}
157157

158158
private function validate(string $template, string $file): array

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ protected function findExtension($name)
112112
public function validateConfiguration(ExtensionInterface $extension, $configuration)
113113
{
114114
if (!$configuration) {
115-
throw new \LogicException(sprintf('The extension with alias "%s" does not have its getConfiguration() method setup', $extension->getAlias()));
115+
throw new \LogicException(sprintf('The extension with alias "%s" does not have its getConfiguration() method setup.', $extension->getAlias()));
116116
}
117117

118118
if (!$configuration instanceof ConfigurationInterface) {
119-
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', \get_class($configuration)));
119+
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable.', \get_class($configuration)));
120120
}
121121
}
122122

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8585
$fs->remove($oldCacheDir);
8686

8787
if (!is_writable($realCacheDir)) {
88-
throw new RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
88+
throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realCacheDir));
8989
}
9090

9191
$io->comment(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function getConfigForPath(array $config, string $path, string $alias)
145145

146146
foreach ($steps as $step) {
147147
if (!\array_key_exists($step, $config)) {
148-
throw new LogicException(sprintf('Unable to find configuration for "%s.%s"', $alias, $path));
148+
throw new LogicException(sprintf('Unable to find configuration for "%s.%s".', $alias, $path));
149149
}
150150

151151
$config = $config[$step];

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function process(ContainerBuilder $container)
3939

4040
if (isset($attributes[0]['template'])) {
4141
if (!isset($attributes[0]['id'])) {
42-
throw new InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template', $id));
42+
throw new InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template.', $id));
4343
}
4444
$template = [$attributes[0]['id'], $attributes[0]['template']];
4545
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11961196
if ($container->fileExists($dir)) {
11971197
$dirs[] = $transPaths[] = $dir;
11981198
} else {
1199-
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
1199+
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory.', $dir));
12001200
}
12011201
}
12021202

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/StopwatchHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public function __call($method, $arguments = [])
4747
return $this->stopwatch->{$method}(...$arguments);
4848
}
4949

50-
throw new \BadMethodCallException(sprintf('Method "%s" of Stopwatch does not exist', $method));
50+
throw new \BadMethodCallException(sprintf('Method "%s" of Stopwatch does not exist.', $method));
5151
}
5252
}

src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected static function createClient(array $options = [], array $server = [])
5353
if (class_exists(KernelBrowser::class)) {
5454
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
5555
}
56-
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"');
56+
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit".');
5757
}
5858

5959
$client->setServerParameters($server);

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ private function determineEntryPoint(?string $defaultEntryPointId, array $config
115115
}
116116

117117
// we have multiple entry points - we must ask them to configure one
118-
throw new \LogicException(sprintf('Because you have multiple guard authenticators, you need to set the "guard.entry_point" key to one of your authenticators (%s)', implode(', ', $authenticatorIds)));
118+
throw new \LogicException(sprintf('Because you have multiple guard authenticators, you need to set the "guard.entry_point" key to one of your authenticators (%s).', implode(', ', $authenticatorIds)));
119119
}
120120
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ private function createUserDaoProvider(string $name, array $provider, ContainerB
655655
return $name;
656656
}
657657

658-
throw new InvalidConfigurationException(sprintf('Unable to create definition for "%s" user provider', $name));
658+
throw new InvalidConfigurationException(sprintf('Unable to create definition for "%s" user provider.', $name));
659659
}
660660

661661
private function getUserProviderId(string $name): string

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function process(ContainerBuilder $container)
3939
}
4040

4141
if (!$found) {
42-
throw new LogicException('No twig loaders found. You need to tag at least one loader with "twig.loader"');
42+
throw new LogicException('No twig loaders found. You need to tag at least one loader with "twig.loader".');
4343
}
4444

4545
if (1 === $found) {

src/Symfony/Component/Asset/UrlPackage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function getSslUrls(array $urls)
128128
if ('https://' === substr($url, 0, 8) || '//' === substr($url, 0, 2)) {
129129
$sslUrls[] = $url;
130130
} elseif (null === parse_url($url, PHP_URL_SCHEME)) {
131-
throw new InvalidArgumentException(sprintf('"%s" is not a valid URL', $url));
131+
throw new InvalidArgumentException(sprintf('"%s" is not a valid URL.', $url));
132132
}
133133
}
134134

src/Symfony/Component/Asset/VersionStrategy/JsonManifestVersionStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private function getManifestPath(string $path): ?string
5959

6060
$this->manifestData = json_decode(file_get_contents($this->manifestPath), true);
6161
if (0 < json_last_error()) {
62-
throw new \RuntimeException(sprintf('Error parsing JSON from asset manifest file "%s" - %s', $this->manifestPath, json_last_error_msg()));
62+
throw new \RuntimeException(sprintf('Error parsing JSON from asset manifest file "%s" - %s.', $this->manifestPath, json_last_error_msg()));
6363
}
6464
}
6565

src/Symfony/Component/BrowserKit/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ protected function doRequestInProcess($request)
465465
}
466466

467467
if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {
468-
throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput()));
468+
throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s.', $process->getOutput(), $process->getErrorOutput()));
469469
}
470470

471471
return unserialize($process->getOutput());

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function __construct(string $namespace = '', int $defaultLifetime = 0)
4141
{
4242
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).static::NS_SEPARATOR;
4343
if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
44-
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
44+
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace));
4545
}
4646
$this->createCacheItem = \Closure::bind(
4747
static function ($key, $value, $isHit) use ($defaultLifetime) {

src/Symfony/Component/Cache/CacheItem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function expiresAt($expiration): self
8282
} elseif ($expiration instanceof \DateTimeInterface) {
8383
$this->expiry = (float) $expiration->format('U.u');
8484
} else {
85-
throw new InvalidArgumentException(sprintf('Expiration date must implement DateTimeInterface or be null, "%s" given', \is_object($expiration) ? \get_class($expiration) : \gettype($expiration)));
85+
throw new InvalidArgumentException(sprintf('Expiration date must implement DateTimeInterface or be null, "%s" given.', \is_object($expiration) ? \get_class($expiration) : \gettype($expiration)));
8686
}
8787

8888
return $this;
@@ -102,7 +102,7 @@ public function expiresAfter($time): self
102102
} elseif (\is_int($time)) {
103103
$this->expiry = $time + microtime(true);
104104
} else {
105-
throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given', \is_object($time) ? \get_class($time) : \gettype($time)));
105+
throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given.', \is_object($time) ? \get_class($time) : \gettype($time)));
106106
}
107107

108108
return $this;
@@ -121,13 +121,13 @@ public function tag($tags): ItemInterface
121121
}
122122
foreach ($tags as $tag) {
123123
if (!\is_string($tag)) {
124-
throw new InvalidArgumentException(sprintf('Cache tag must be string, "%s" given', \is_object($tag) ? \get_class($tag) : \gettype($tag)));
124+
throw new InvalidArgumentException(sprintf('Cache tag must be string, "%s" given.', \is_object($tag) ? \get_class($tag) : \gettype($tag)));
125125
}
126126
if (isset($this->newMetadata[self::METADATA_TAGS][$tag])) {
127127
continue;
128128
}
129129
if ('' === $tag) {
130-
throw new InvalidArgumentException('Cache tag length must be greater than zero');
130+
throw new InvalidArgumentException('Cache tag length must be greater than zero.');
131131
}
132132
if (false !== strpbrk($tag, self::RESERVED_CHARACTERS)) {
133133
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters %s', $tag, self::RESERVED_CHARACTERS));
@@ -168,10 +168,10 @@ public function getPreviousTags(): array
168168
public static function validateKey($key): string
169169
{
170170
if (!\is_string($key)) {
171-
throw new InvalidArgumentException(sprintf('Cache key must be string, "%s" given', \is_object($key) ? \get_class($key) : \gettype($key)));
171+
throw new InvalidArgumentException(sprintf('Cache key must be string, "%s" given.', \is_object($key) ? \get_class($key) : \gettype($key)));
172172
}
173173
if ('' === $key) {
174-
throw new InvalidArgumentException('Cache key length must be greater than zero');
174+
throw new InvalidArgumentException('Cache key length must be greater than zero.');
175175
}
176176
if (false !== strpbrk($key, self::RESERVED_CHARACTERS)) {
177177
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters %s', $key, self::RESERVED_CHARACTERS));

src/Symfony/Component/Cache/Simple/AbstractCache.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function __construct(string $namespace = '', int $defaultLifetime = 0)
4545
$this->defaultLifetime = max(0, $defaultLifetime);
4646
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).':';
4747
if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
48-
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
48+
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace));
4949
}
5050
}
5151

@@ -89,7 +89,7 @@ public function getMultiple($keys, $default = null)
8989
if ($keys instanceof \Traversable) {
9090
$keys = iterator_to_array($keys, false);
9191
} elseif (!\is_array($keys)) {
92-
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
92+
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
9393
}
9494
$ids = [];
9595

@@ -115,7 +115,7 @@ public function getMultiple($keys, $default = null)
115115
public function setMultiple($values, $ttl = null)
116116
{
117117
if (!\is_array($values) && !$values instanceof \Traversable) {
118-
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values)));
118+
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given.', \is_object($values) ? \get_class($values) : \gettype($values)));
119119
}
120120
$valuesById = [];
121121

@@ -156,7 +156,7 @@ public function deleteMultiple($keys)
156156
if ($keys instanceof \Traversable) {
157157
$keys = iterator_to_array($keys, false);
158158
} elseif (!\is_array($keys)) {
159-
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
159+
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
160160
}
161161

162162
return $this->deleteItems($keys);
@@ -174,7 +174,7 @@ private function normalizeTtl($ttl)
174174
return 0 < $ttl ? $ttl : false;
175175
}
176176

177-
throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given', \is_object($ttl) ? \get_class($ttl) : \gettype($ttl)));
177+
throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given.', \is_object($ttl) ? \get_class($ttl) : \gettype($ttl)));
178178
}
179179

180180
private function generateValues(iterable $values, array &$keys, $default): iterable

0 commit comments

Comments
 (0)