Skip to content

Commit 85f59e7

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add missing dots at the end of exception messages
2 parents 7e41b4f + 1791cbf commit 85f59e7

11 files changed

+17
-17
lines changed

File/File.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function move($directory, $name = null)
9191
$renamed = rename($this->getPathname(), $target);
9292
restore_error_handler();
9393
if (!$renamed) {
94-
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error)));
94+
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
9595
}
9696

9797
@chmod($target, 0666 & ~umask());
@@ -106,10 +106,10 @@ protected function getTargetFile($directory, $name = null)
106106
{
107107
if (!is_dir($directory)) {
108108
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
109-
throw new FileException(sprintf('Unable to create the "%s" directory', $directory));
109+
throw new FileException(sprintf('Unable to create the "%s" directory.', $directory));
110110
}
111111
} elseif (!is_writable($directory)) {
112-
throw new FileException(sprintf('Unable to write in the "%s" directory', $directory));
112+
throw new FileException(sprintf('Unable to write in the "%s" directory.', $directory));
113113
}
114114

115115
$target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));

File/MimeType/MimeTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function guess($path)
130130
}
131131

132132
if (2 === \count($this->guessers) && !FileBinaryMimeTypeGuesser::isSupported() && !FileinfoMimeTypeGuesser::isSupported()) {
133-
throw new \LogicException('Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)');
133+
throw new \LogicException('Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?).');
134134
}
135135

136136
return null;

File/UploadedFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function move($directory, $name = null)
208208
$moved = move_uploaded_file($this->getPathname(), $target);
209209
restore_error_handler();
210210
if (!$moved) {
211-
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error)));
211+
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
212212
}
213213

214214
@chmod($target, 0666 & ~umask());

Session/Storage/Handler/MemcachedSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(\Memcached $memcached, array $options = [])
4747
$this->memcached = $memcached;
4848

4949
if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) {
50-
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
50+
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff)));
5151
}
5252

5353
$this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400;

Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MongoDbSessionHandler extends AbstractSessionHandler
6666
public function __construct(\MongoDB\Client $mongo, array $options)
6767
{
6868
if (!isset($options['database']) || !isset($options['collection'])) {
69-
throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler');
69+
throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.');
7070
}
7171

7272
$this->mongo = $mongo;

Session/Storage/Handler/NativeFileSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public function __construct(string $savePath = null)
3838

3939
if ($count = substr_count($savePath, ';')) {
4040
if ($count > 2) {
41-
throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'', $savePath));
41+
throw new \InvalidArgumentException(sprintf('Invalid argument $savePath \'%s\'.', $savePath));
4242
}
4343

4444
// characters after last ';' are the path
4545
$baseDir = ltrim(strrchr($savePath, ';'), ';');
4646
}
4747

4848
if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) {
49-
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $baseDir));
49+
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir));
5050
}
5151

5252
ini_set('session.save_path', $savePath);

Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function __construct($pdoOrDsn = null, array $options = [])
174174
{
175175
if ($pdoOrDsn instanceof \PDO) {
176176
if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
177-
throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__));
177+
throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __CLASS__));
178178
}
179179

180180
$this->pdo = $pdoOrDsn;
@@ -468,7 +468,7 @@ private function buildDsnFromUrl(string $dsnOrUrl): string
468468
}
469469

470470
if (!isset($params['scheme'])) {
471-
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler');
471+
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler.');
472472
}
473473

474474
$driverAliasMap = [

Session/Storage/MockArraySessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function setName($name)
148148
public function save()
149149
{
150150
if (!$this->started || $this->closed) {
151-
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed');
151+
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
152152
}
153153
// nothing to do since we don't persist the session data
154154
$this->closed = false;

Session/Storage/MockFileSessionStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(string $savePath = null, string $name = 'MOCKSESSID'
3737
}
3838

3939
if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) {
40-
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $savePath));
40+
throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $savePath));
4141
}
4242

4343
$this->savePath = $savePath;
@@ -87,7 +87,7 @@ public function regenerate($destroy = false, $lifetime = null)
8787
public function save()
8888
{
8989
if (!$this->started) {
90-
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed');
90+
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
9191
}
9292

9393
$data = $this->data;

Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function start()
149149

150150
// ok to try and start the session
151151
if (!session_start()) {
152-
throw new \RuntimeException('Failed to start the session');
152+
throw new \RuntimeException('Failed to start the session.');
153153
}
154154

155155
if (null !== $this->emulateSameSite) {

Session/Storage/Proxy/AbstractProxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getId()
8888
public function setId($id)
8989
{
9090
if ($this->isActive()) {
91-
throw new \LogicException('Cannot change the ID of an active session');
91+
throw new \LogicException('Cannot change the ID of an active session.');
9292
}
9393

9494
session_id($id);
@@ -114,7 +114,7 @@ public function getName()
114114
public function setName($name)
115115
{
116116
if ($this->isActive()) {
117-
throw new \LogicException('Cannot change the name of an active session');
117+
throw new \LogicException('Cannot change the name of an active session.');
118118
}
119119

120120
session_name($name);

0 commit comments

Comments
 (0)