Skip to content

Commit c0efac9

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Add missing dots at the end of exception messages [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict) Fix bad merge Add missing dots at the end of exception messages
2 parents 6f9c2ba + 01887e8 commit c0efac9

11 files changed

+18
-18
lines changed

File/File.php

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

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

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

File/UploadedFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function move(string $directory, string $name = null)
181181
$moved = move_uploaded_file($this->getPathname(), $target);
182182
restore_error_handler();
183183
if (!$moved) {
184-
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error)));
184+
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
185185
}
186186

187187
@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/Handler/RedisSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public function __construct($redis, array $options = [])
5454
!$redis instanceof RedisProxy &&
5555
!$redis instanceof RedisClusterProxy
5656
) {
57-
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
57+
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
5858
}
5959

6060
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
61-
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
61+
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff)));
6262
}
6363

6464
$this->redis = $redis;

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(string $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
@@ -36,7 +36,7 @@ public function __construct(string $savePath = null, string $name = 'MOCKSESSID'
3636
}
3737

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

4242
$this->savePath = $savePath;
@@ -86,7 +86,7 @@ public function regenerate(bool $destroy = false, int $lifetime = null)
8686
public function save()
8787
{
8888
if (!$this->started) {
89-
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed');
89+
throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.');
9090
}
9191

9292
$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
@@ -86,7 +86,7 @@ public function getId()
8686
public function setId(string $id)
8787
{
8888
if ($this->isActive()) {
89-
throw new \LogicException('Cannot change the ID of an active session');
89+
throw new \LogicException('Cannot change the ID of an active session.');
9090
}
9191

9292
session_id($id);
@@ -110,7 +110,7 @@ public function getName()
110110
public function setName(string $name)
111111
{
112112
if ($this->isActive()) {
113-
throw new \LogicException('Cannot change the name of an active session');
113+
throw new \LogicException('Cannot change the name of an active session.');
114114
}
115115

116116
session_name($name);

0 commit comments

Comments
 (0)