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

Skip to content

Commit 3543bf6

Browse files
committed
minor #36081 Add missing dots at the end of exception messages (fabpot)
This PR was merged into the 4.4 branch. Discussion ---------- Add missing dots at the end of exception messages | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | 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 ------- 6dad402 Add missing dots at the end of exception messages
2 parents cc8d23a + 6dad402 commit 3543bf6

File tree

43 files changed

+73
-73
lines changed

Some content is hidden

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

43 files changed

+73
-73
lines changed

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public function __construct(RequestStack $requestStack, array $exclusions, $acti
3232
{
3333
foreach ($exclusions as $exclusion) {
3434
if (!\array_key_exists('code', $exclusion)) {
35-
throw new \LogicException(sprintf('An exclusion must have a "code" key'));
35+
throw new \LogicException(sprintf('An exclusion must have a "code" key.'));
3636
}
3737
if (!\array_key_exists('urls', $exclusion)) {
38-
throw new \LogicException(sprintf('An exclusion must have a "urls" key'));
38+
throw new \LogicException(sprintf('An exclusion must have a "urls" key.'));
3939
}
4040
}
4141

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
4848

4949
foreach ($thresholds as $group => $threshold) {
5050
if (!\in_array($group, $groups, true)) {
51-
throw new \InvalidArgumentException(sprintf('Unrecognized threshold "%s", expected one of "%s"', $group, implode('", "', $groups)));
51+
throw new \InvalidArgumentException(sprintf('Unrecognized threshold "%s", expected one of "%s".', $group, implode('", "', $groups)));
5252
}
5353
if (!is_numeric($threshold)) {
54-
throw new \InvalidArgumentException(sprintf('Threshold for group "%s" has invalid value "%s"', $group, $threshold));
54+
throw new \InvalidArgumentException(sprintf('Threshold for group "%s" has invalid value "%s".', $group, $threshold));
5555
}
5656
$this->thresholds[$group] = (int) $threshold;
5757
}
@@ -146,7 +146,7 @@ public static function fromUrlEncodedString($serializedConfiguration)
146146
parse_str($serializedConfiguration, $normalizedConfiguration);
147147
foreach (array_keys($normalizedConfiguration) as $key) {
148148
if (!\in_array($key, ['max', 'disabled', 'verbose'], true)) {
149-
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s"', $key));
149+
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s".', $key));
150150
}
151151
}
152152

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function originatesFromAnObject()
109109
public function originatingClass()
110110
{
111111
if (null === $this->originClass) {
112-
throw new \LogicException('Check with originatesFromAnObject() before calling this method');
112+
throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
113113
}
114114

115115
return $this->originClass;
@@ -121,7 +121,7 @@ public function originatingClass()
121121
public function originatingMethod()
122122
{
123123
if (null === $this->originMethod) {
124-
throw new \LogicException('Check with originatesFromAnObject() before calling this method');
124+
throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
125125
}
126126

127127
return $this->originMethod;
@@ -237,7 +237,7 @@ private function getPackage($path)
237237
$relativePath = substr($path, \strlen($vendorRoot) + 1);
238238
$vendor = strstr($relativePath, \DIRECTORY_SEPARATOR, true);
239239
if (false === $vendor) {
240-
throw new \RuntimeException(sprintf('Could not find directory separator "%s" in path "%s"', \DIRECTORY_SEPARATOR, $relativePath));
240+
throw new \RuntimeException(sprintf('Could not find directory separator "%s" in path "%s".', \DIRECTORY_SEPARATOR, $relativePath));
241241
}
242242

243243
return rtrim($vendor.'/'.strstr(substr(
@@ -247,7 +247,7 @@ private function getPackage($path)
247247
}
248248
}
249249

250-
throw new \RuntimeException(sprintf('No vendors found for path "%s"', $path));
250+
throw new \RuntimeException(sprintf('No vendors found F438 for path "%s".', $path));
251251
}
252252

253253
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
106106
$filter = $input->getOption('filter');
107107

108108
if (null !== $name && [] === $this->getFilesystemLoaders()) {
109-
throw new InvalidArgumentException(sprintf('Argument "name" not supported, it requires the Twig loader "%s"', FilesystemLoader::class));
109+
throw new InvalidArgumentException(sprintf('Argument "name" not supported, it requires the Twig loader "%s".', FilesystemLoader::class));
110110
}
111111

112112
switch ($input->getOption('format')) {

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function setContainer(ContainerInterface $container): ?ContainerInterface
6565
protected function getParameter(string $name)
6666
{
6767
if (!$this->container->has('parameter_bag')) {
68-
throw new ServiceNotFoundException('parameter_bag', null, null, [], sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', static::class));
68+
throw new ServiceNotFoundException('parameter_bag.', null, null, [], sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', static::class));
6969
}
7070

7171
return $this->container->get('parameter_bag')->get($name);

src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function resolveControllerName(...$args)
4949
public function __call(string $method, array $args)
5050
{
5151
if ('onKernelRequest' !== $method && 'onKernelRequest' !== strtolower($method)) {
52-
throw new \Error(sprintf('Error: Call to undefined method %s::%s()', static::class, $method));
52+
throw new \Error(sprintf('Error: Call to undefined method %s::%s().', static::class, $method));
5353
}
5454

5555
$event = $args[0];

src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function loadEnvVars(): array
177177
private function loadKeys(): void
178178
{
179179
if (!\function_exists('sodium_crypto_box_seal')) {
180-
throw new \LogicException('The "sodium" PHP extension is required to deal with secrets. Alternatively, try running "composer require paragonie/sodium_compat" if you cannot enable the extension."');
180+
throw new \LogicException('The "sodium" PHP extension is required to deal with secrets. Alternatively, try running "composer require paragonie/sodium_compat" if you cannot enable the extension.".');
181181
}
182182

183183
if (null !== $this->encryptionKey || '' !== $this->decryptionKey = (string) $this->decryptionKey) {
@@ -214,7 +214,7 @@ private function export(string $file, string $data): void
214214
private function createSecretsDir(): void
215215
{
216216
if ($this->secretsDir && !is_dir($this->secretsDir) && !@mkdir($this->secretsDir, 0777, true) && !is_dir($this->secretsDir)) {
217-
throw new \RuntimeException(sprintf('Unable to create the secrets directory (%s)', $this->secretsDir));
217+
throw new \RuntimeException(sprintf('Unable to create the secrets directory (%s).', $this->secretsDir));
218218
}
219219

220220
$this->secretsDir = null;

src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.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).':';
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function tag($tags): ItemInterface
130130
throw new InvalidArgumentException('Cache tag length must be greater than zero.');
131131
}
132132
if (false !== strpbrk($tag, self::RESERVED_CHARACTERS)) {
133-
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters %s', $tag, self::RESERVED_CHARACTERS));
133+
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters %s.', $tag, self::RESERVED_CHARACTERS));
134134
}
135135
$this->newMetadata[self::METADATA_TAGS][$tag] = $tag;
136136
}
@@ -174,7 +174,7 @@ public static function validateKey($key): string
174174
throw new InvalidArgumentException('Cache key length must be greater than zero.');
175175
}
176176
if (false !== strpbrk($key, self::RESERVED_CHARACTERS)) {
177-
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters %s', $key, self::RESERVED_CHARACTERS));
177+
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters %s.', $key, self::RESERVED_CHARACTERS));
178178
}
179179

180180
return $key;

src/Symfony/Component/Cache/Psr16Cache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function getMultiple($keys, $default = null)
144144
if ($keys instanceof \Traversable) {
145145
$keys = iterator_to_array($keys, false);
146146
} elseif (!\is_array($keys)) {
147-
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
147+
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
148148
}
149149

150150
try {
@@ -193,7 +193,7 @@ public function setMultiple($values, $ttl = null)
193193
{
194194
$valuesIsArray = \is_array($values);
195195
if (!$valuesIsArray && !$values instanceof \Traversable) {
196-
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values)));
196+
throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given.', \is_object($values) ? \get_class($values) : \gettype($values)));
197197
}
198198
$items = [];
199199

@@ -247,7 +247,7 @@ public function deleteMultiple($keys)
247247
if ($keys instanceof \Traversable) {
248248
$keys = iterator_to_array($keys, false);
249249
} elseif (!\is_array($keys)) {
250-
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
250+
throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given.', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
251251
}
252252

253253
try {

0 commit comments

Comments
 (0)
0