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

Skip to content

Commit df1caae

Browse files
committed
minor #36087 Add missing dots at the end of exception messages (fabpot)
This PR was merged into the 5.1-dev branch. Discussion ---------- Add missing dots at the end of exception messages | Q | A | ------------- | --- | Branch? | master | 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 ------- c46d702 Add missing dots at the end of exception messages
2 parents d6dd06b + c46d702 commit df1caae

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ protected function buildMessage(string $content, array $records): Email
101101
} elseif (\is_callable($this->messageTemplate)) {
102102
$message = \call_user_func($this->messageTemplate, $content, $records);
103103
if (!$message instanceof Email) {
104-
throw new \InvalidArgumentException(sprintf('Could not resolve message from a callable. Instance of "%s" is expected', Email::class));
104+
throw new \InvalidArgumentException(sprintf('Could not resolve message from a callable. Instance of "%s" is expected.', Email::class));
105105
}
106106
} else {
107-
throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it');
107+
throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it.');
108108
}
109109

110110
if ($records) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
8383

8484
foreach ($verboseOutput as $group => $status) {
8585
if (!isset($this->verboseOutput[$group])) {
86-
throw new \InvalidArgumentException(sprintf('Unsupported verbosity group "%s", expected one of "%s"', $group, implode('", "', array_keys($this->verboseOutput))));
86+
throw new \InvalidArgumentException(sprintf('Unsupported verbosity group "%s", expected one of "%s".', $group, implode('", "', array_keys($this->verboseOutput))));
8787
}
8888
$this->verboseOutput[$group] = (bool) $status;
8989
}
@@ -162,7 +162,7 @@ public static function fromUrlEncodedString($serializedConfiguration)
162162
parse_str($serializedConfiguration, $normalizedConfiguration);
163163
foreach (array_keys($normalizedConfiguration) as $key) {
164164
if (!\in_array($key, ['max', 'disabled', 'verbose', 'quiet'], true)) {
165 9E88 -
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s"', $key));
165+
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s".', $key));
166166
}
167167
}
168168

src/Symfony/Component/Lock/Store/MongoDbStore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ public function save(Key $key)
198198
$this->upsert($key, $this->initialTtl);
199199
} catch (WriteException $e) {
200200
if ($this->isDuplicateKeyException($e)) {
201-
throw new LockConflictedException('Lock was acquired by someone else', 0, $e);
201+
throw new LockConflictedException('Lock was acquired by someone else.', 0, $e);
202202
}
203-
throw new LockAcquiringException('Failed to acquire lock', 0, $e);
203+
throw new LockAcquiringException('Failed to acquire lock.', 0, $e);
204204
}
205205

206206
if ($this->options['gcProbablity'] > 0.0 && (1.0 === $this->options['gcProbablity'] || (random_int(0, PHP_INT_MAX) / PHP_INT_MAX) <= $this->options['gcProbablity'])) {
@@ -232,7 +232,7 @@ public function putOffExpiration(Key $key, $ttl)
232232
$this->upsert($key, $ttl);
233233
} catch (WriteException $e) {
234234
if ($this->isDuplicateKeyException($e)) {
235-
throw new LockConflictedException('Failed to put off the expiration of the lock', 0, $e);
235+
throw new LockConflictedException('Failed to put off the expiration of the lock.', 0, $e);
236236
}
237237
throw new LockStorageException($e->getMessage(), 0, $e);
238238
}

src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter
117117
// check for extra keys in options
118118
$optionsExtraKeys = array_diff(array_keys($options), array_keys($configuration));
119119
if (0 < \count($optionsExtraKeys)) {
120-
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
120+
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s].', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
121121
}
122122

123123
// check for extra keys in options
124124
$queryExtraKeys = array_diff(array_keys($query), array_keys($configuration));
125125
if (0 < \count($queryExtraKeys)) {
126-
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
126+
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s].', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
127127
}
128128

129129
return new self($configuration, $client);

src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public function channel(): \AMQPChannel
470470
$credentials['password'] = '********';
471471
unset($credentials['delay']);
472472

473-
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s)', json_encode($credentials)), 0, $e);
473+
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s).', json_encode($credentials)), 0, $e);
474474
}
475475
$this->amqpChannel = $this->amqpFactory->createChannel($connection);
476476

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ public static function buildConfiguration(string $dsn, array $options = []): arr
9999
// check for extra keys in options
100100
$optionsExtraKeys = array_diff(array_keys($options), array_keys(static::DEFAULT_OPTIONS));
101101
if (0 < \count($optionsExtraKeys)) {
102-
throw new InvalidArgumentException(sprintf('Unknown option found: [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(static::DEFAULT_OPTIONS))));
102+
throw new InvalidArgumentException(sprintf('Unknown option found: [%s]. Allowed options are [%s].', implode(', ', $optionsExtraKeys), implode(', ', array_keys(static::DEFAULT_OPTIONS))));
103103
}
104104

105105
// check for extra keys in options
106106
$queryExtraKeys = array_diff(array_keys($query), array_keys(static::DEFAULT_OPTIONS));
107107
if (0 < \count($queryExtraKeys)) {
108-
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(static::DEFAULT_OPTIONS))));
108+
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s].', implode(', ', $queryExtraKeys), implode(', ', array_keys(static::DEFAULT_OPTIONS))));
109109
}
110110

111111
return $configuration;

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public function __construct(array $configuration, array $connectionCredentials =
6262
$this->connection->setOption(\Redis::OPT_SERIALIZER, $redisOptions['serializer'] ?? \Redis::SERIALIZER_PHP);
6363

6464
if (isset($connectionCredentials['auth']) && !$this->connection->auth($connectionCredentials['auth'])) {
65-
throw new InvalidArgumentException(sprintf('Redis connection failed: %s', $redis->getLastError()));
65+
throw new InvalidArgumentException(sprintf('Redis connection failed: %s.', $redis->getLastError()));
6666
}
6767

6868
if (($dbIndex = $configuration['dbindex'] ?? self::DEFAULT_OPTIONS['dbindex']) && !$this->connection->select($dbIndex)) {
69-
throw new InvalidArgumentException(sprintf('Redis connection failed: %s', $redis->getLastError()));
69+
throw new InvalidArgumentException(sprintf('Redis connection failed: %s.', $redis->getLastError()));
7070
}
7171

7272
$this->stream = $configuration['stream'] ?? self::DEFAULT_OPTIONS['stream'];

src/Symfony/Component/Messenger/Transport/TransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function createTransport(string $dsn, array $options, SerializerInterface
4747
$packageSuggestion = ' Run "composer require symfony/redis-messenger" to install Redis transport.';
4848
}
4949

50-
throw new InvalidArgumentException(sprintf('No transport supports the given Messenger DSN "%s".%s', $dsn, $packageSuggestion));
50+
throw new InvalidArgumentException(sprintf('No transport supports the given Messenger DSN "%s".%s.', $dsn, $packageSuggestion));
5151
}
5252

5353
public function supports(string $dsn, array $options): bool

src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function doSend(MessageInterface $message): void
6262
$options['to'] = $message->getRecipientId();
6363
}
6464
if (null === $options['to']) {
65-
throw new InvalidArgumentException(sprintf('The "%s" transport required the "to" option to be set', __CLASS__));
65+
throw new InvalidArgumentException(sprintf('The "%s" transport required the "to" option to be set.', __CLASS__));
6666
}
6767
$options['notification'] = $options['notification'] ?? [];
6868
$options['notification']['body'] = $message->getSubject();

src/Symfony/Component/PropertyInfo/PropertyWriteInfo.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getType(): string
5454
public function getName(): string
5555
{
5656
if (null === $this->name) {
57-
throw new \LogicException("Calling getName() when having a mutator of type {$this->type} is not tolerated");
57+
throw new \LogicException("Calling getName() when having a mutator of type {$this->type} is not tolerated.");
5858
}
5959

6060
return $this->name;
@@ -68,7 +68,7 @@ public function setAdderInfo(self $adderInfo): void
6868
public function getAdderInfo(): self
6969
{
7070
if (null === $this->adderInfo) {
71-
throw new \LogicException("Calling getAdderInfo() when having a mutator of type {$this->type} is not tolerated");
71+
throw new \LogicException("Calling getAdderInfo() when having a mutator of type {$this->type} is not tolerated.");
7272
}
7373

7474
return $this->adderInfo;
@@ -82,7 +82,7 @@ public function setRemoverInfo(self $removerInfo): void
8282
public function getRemoverInfo(): self
8383
{
8484
if (null === $this->removerInfo) {
85-
throw new \LogicException("Calling getRemoverInfo() when having a mutator of type {$this->type} is not tolerated");
85+
throw new \LogicException("Calling getRemoverInfo() when having a mutator of type {$this->type} is not tolerated.");
8686
}
8787

8888
return $this->removerInfo;
@@ -91,7 +91,7 @@ public function getRemoverInfo(): self
9191
public function getVisibility(): string
9292
{
9393
if (null === $this->visibility) {
94-
throw new \LogicException("Calling getVisibility() when having a mutator of type {$this->type} is not tolerated");
94+
throw new \LogicException("Calling getVisibility() when having a mutator of type {$this->type} is not tolerated.");
9595
}
9696

9797
return $this->visibility;
@@ -100,7 +100,7 @@ public function getVisibility(): string
100100
public function isStatic(): bool
101101
{
102102
if (null === $this->static) {
103-
throw new \LogicException("Calling isStatic() when having a mutator of type {$this->type} is not tolerated");
103+
throw new \LogicException("Calling isStatic() when having a mutator of type {$this->type} is not tolerated.");
104104
}
105105

106106
return $this->static;

src/Symfony/Component/Serializer/Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function denormalize($data, string $type, string $format = null, array $c
186186
{
187187
if (isset(self::SCALAR_TYPES[$type])) {
188188
if (!('is_'.$type)($data)) {
189-
throw new NotNormalizableValueException(sprintf('Data expected to be of type "%s" ("%s" given)', $type, \is_object($data) ? \get_class($data) : \gettype($data)));
189+
throw new NotNormalizableValueException(sprintf('Data expected to be of type "%s" ("%s" given).', $type, \is_object($data) ? \get_class($data) : \gettype($data)));
190190
}
191191

192192
return $data;

src/Symfony/Component/Validator/Constraints/Count.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct($options = null)
5555
parent::__construct($options);
5656

5757
if (null === $this->min && null === $this->max && null === $this->divisibleBy) {
58-
throw new MissingOptionsException(sprintf('Either option "min", "max" or "divisibleBy" must be given for constraint %s', __CLASS__), ['min', 'max', 'divisibleBy']);
58+
throw new MissingOptionsException(sprintf('Either option "min", "max" or "divisibleBy" must be given for constraint %s.', __CLASS__), ['min', 'max', 'divisibleBy']);
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)
0