10000 minor #36080 Add missing dots at the end of exception messages (fabpot) · symfony/symfony@13ea421 · GitHub
[go: up one dir, main page]

Skip to content

Commit 13ea421

Browse files
committed
minor #36080 Add missing dots at the end of exception messages (fabpot)
This PR was merged into the 3.4 branch. Discussion ---------- Add missing dots at the end of exception messages | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | n/a Commits ------- bb8a66e Add missing dots at the end of exception messages
2 parents a562ba2 + bb8a66e commit 13ea421

File tree

182 files changed

+335
-335
lines changed

Some content is hidden

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

182 files changed

+335
-335
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private function addTaggedSubscribers(ContainerBuilder $container)
6868
$connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections);
6969
foreach ($connections as $con) {
7070
if (!isset($this->connections[$con])) {
71-
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))));
71+
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))));
7272
}
7373

7474
$this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', [new Reference($id)]);
@@ -91,7 +91,7 @@ private function addTaggedListeners(ContainerBuilder $container)
9191
$connections = isset($tag['connection']) ? [$tag['connection']] : array_keys($this->connections);
9292
foreach ($connections as $con) {
9393
if (!isset($this->connections[$con])) {
94-
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))));
94+
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))));
9595
}
9696

9797
if ($lazy = !empty($tag['lazy'])) {

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;
@@ -222,7 +222,7 @@ private function getManagerName(ContainerBuilder $container)
222222
}
223223
}
224224

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

228228
/**

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function destroy($sessionId)
9696
$stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
9797
$stmt->execute();
9898
} catch (\Exception $e) {
99-
throw new \RuntimeException(sprintf('Exception was thrown when trying to delete a session: %s', $e->getMessage()), 0, $e);
99+
throw new \RuntimeException(sprintf('Exception was thrown when trying to delete a session: %s.', $e->getMessage()), 0, $e);
100100
}
101101

102102
return true;
@@ -115,7 +115,7 @@ public function gc($maxlifetime)
115115
$stmt->bindValue(':time', time() - $maxlifetime, \PDO::PARAM_INT);
116116
$stmt->execute();
117117
} catch (\Exception $e) {
118-
throw new \RuntimeException(sprintf('Exception was thrown when trying to delete expired sessions: %s', $e->getMessage()), 0, $e);
118+
throw new \RuntimeException(sprintf('Exception was thrown when trying to delete expired sessions: %s.', $e->getMessage()), 0, $e);
119119
}
120120

121121
return true;
@@ -142,7 +142,7 @@ public function read($sessionId)
142142

143143
return '';
144144
} catch (\Exception $e) {
145-
throw new \RuntimeException(sprintf('Exception was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e);
145+
throw new \RuntimeException(sprintf('Exception was thrown when trying to read the session data: %s.', $e->getMessage()), 0, $e);
146146
}
147147
}
148148

@@ -212,7 +212,7 @@ public function write($sessionId, $data)
212212
}
213213
}
214214
} catch (\Exception $e) {
215-
throw new \RuntimeException(sprintf('Exception was thrown when trying to write the session data: %s', $e->getMessage()), 0, $e);
215+
throw new \RuntimeException(sprintf('Exception was thrown when trying to write the session data: %s.', $e->getMessage()), 0, $e);
216216
}
217217

218218
return true;

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
@@ -83,7 +83,7 @@ private function flushMemorySpool()
8383
}
8484

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

8989
$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
@@ -32,7 +32,7 @@ public function generate(\ReflectionClass $originalClass, ClassGenerator $classG
3232
$newBody = preg_replace('/^(\$this->initializer[a-zA-Z0-9]++) && .*;\n\nreturn (\$this->valueHolder)/', '$1 || $2', $body);
3333

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

3838
$destructor->setBody($newBody);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private function getMetadata($type, $entity)
239239
} elseif (\is_string($cb) && preg_match('{^(.+)::(.+)$}', $cb, $m) && method_exists($m[1], $m[2])) {
240240
$refl = new \ReflectionMethod($m[1], $m[2]);
241241
} else {
242-
throw new \UnexpectedValueException('Unsupported callback type');
242+
throw new \UnexpectedValueException('Unsupported callback type.');
243243
}
244244

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

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

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

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

163163
private function validate($template, $file)

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
@@ -104,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
104104
$fs->remove($oldCacheDir);
105105

106106
if (!is_writable($realCacheDir)) {
107-
throw new RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
107+
throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realCacheDir));
108108
}
109109

110110
$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
@@ -140,7 +140,7 @@ private function getConfigForPath(array $config, $path, $alias)
140140

141141
foreach ($steps as $step) {
142142
if (!\array_key_exists($step, $config)) {
143-
throw new LogicException(sprintf('Unable to find configuration for "%s.%s"', $alias, $path));
143+
throw new LogicException(sprintf('Unable to find configuration for "%s.%s".', $alias, $path));
144144
}
145145

146146
$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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
12011201
if ($container->fileExists($dir)) {
12021202
$dirs[] = $dir;
12031203
} else {
1204-
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
1204+
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory.', $dir));
12051205
}
12061206
}
12071207

@@ -1629,7 +1629,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
16291629
$storeDefinition = new Reference($storeDefinitionId);
16301630
break;
16311631
default:
1632-
throw new InvalidArgumentException(sprintf('Lock store DSN "%s" is not valid in resource "%s"', $storeDsn, $resourceName));
1632+
throw new InvalidArgumentException(sprintf('Lock store DSN "%s" is not valid in resource "%s".', $storeDsn, $resourceName));
16331633
}
16341634

16351635
$storeDefinitions[] = $storeDefinition;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function __call($method, $arguments = [])
4343
return \call_user_func_array([$this->stopwatch, $method], $arguments);
4444
}
4545

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected static function createClient(array $options = [], array $server = [])
3939
if (class_exists(Client::class)) {
4040
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
4141
}
42-
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"');
42+
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".');
4343
}
4444

4545
$client->setServerParameters($server);

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php

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

3939
$voters = $this->findAndSortTaggedServices('security.voter', $container);
4040
if (!$voters) {
41-
throw new LogicException('No security voters found. You need to tag at least one with "security.voter"');
41+
throw new LogicException('No security voters found. You need to tag at least one with "security.voter".');
4242
}
4343

4444
foreach ($voters as $voter) {

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($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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
387387
}
388388

389389
if (isset($this->logoutOnUserChangeByContextKey[$contextKey]) && $this->logoutOnUserChangeByContextKey[$contextKey][1] !== $logoutOnUserChange) {
390-
throw new InvalidConfigurationException(sprintf('Firewalls "%s" and "%s" need to have the same value for option "logout_on_user_change" as they are sharing the context "%s"', $this->logoutOnUserChangeByContextKey[$contextKey][0], $id, $contextKey));
390+
throw new InvalidConfigurationException(sprintf('Firewalls "%s" and "%s" need to have the same value for option "logout_on_user_change" as they are sharing the context "%s".', $this->logoutOnUserChangeByContextKey[$contextKey][0], $id, $contextKey));
391391
}
392392

393393
$this->logoutOnUserChangeByContextKey[$contextKey] = [$id, $logoutOnUserChange];
@@ -701,7 +701,7 @@ private function createUserDaoProvider($name, $provider, ContainerBuilder $conta
701701
return $name;
702702
}
703703

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

707707
private function getUserProviderId($name)

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
@@ -130,7 +130,7 @@ private function getSslUrls($urls)
130130
if ('https://' === substr($url, 0, 8) || '//' === substr($url, 0, 2)) {
131131
$sslUrls[] = $url;
132132
} elseif ('http://' !== substr($url, 0, 7)) {
133-
throw new InvalidArgumentException(sprintf('"%s" is not a valid URL', $url));
133+
throw new InvalidArgumentException(sprintf('"%s" is not a valid URL.', $url));
134134
}
135135
}
136136

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($path)
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
@@ -370,7 +370,7 @@ protected function doRequestInProcess($request)
370370
}
371371

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

376376
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
@@ -46,7 +46,7 @@ protected function __construct($namespace = '', $defaultLifetime = 0)
4646
{
4747
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).static::NS_SEPARATOR;
4848
if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
49-
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
49+
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s").', $this->maxIdLength - 24, \strlen($namespace), $namespace));
5050
}
5151
$this->createCacheItem = \Closure::bind(
5252
static function ($key, $value, $isHit) use ($defaultLifetime) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface
2929
public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
3030
{
3131
if (!static::isSupported()) {
32-
throw new CacheException('OPcache is not enabled');
32+
throw new CacheException('OPcache is not enabled.');
3333
}
3434
parent::__construct('', $defaultLifetime);
3535
$this->init($namespace, $directory);

0 commit comments

Comments
 (0)
0