Skip to content

Commit 9f9eb47

Browse files
Merge branch '5.4' into 6.0
* 5.4: CS fixes Bump Symfony version to 5.4.11 Update VERSION for 5.4.10 Update CHANGELOG for 5.4.10 Bump Symfony version to 4.4.44 Update VERSION for 4.4.43 Update CONTRIBUTORS for 4.4.43 Update CHANGELOG for 4.4.43
2 parents 47f2aa6 + 1d3d261 commit 9f9eb47

21 files changed

+46
-46
lines changed

File/UploadedFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ public function move(string $directory, string $name = null): File
209209
*/
210210
public static function getMaxFilesize(): int|float
211211
{
212-
$sizePostMax = self::parseFilesize(ini_get('post_max_size'));
213-
$sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));
212+
$sizePostMax = self::parseFilesize(\ini_get('post_max_size'));
213+
$sizeUploadMax = self::parseFilesize(\ini_get('upload_max_filesize'));
214214

215215
return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX);
216216
}

InputBag.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ final class InputBag extends ParameterBag
2727
*/
2828
public function get(string $key, mixed $default = null): string|int|float|bool|null
2929
{
30-
if (null !== $default && !is_scalar($default) && !$default instanceof \Stringable) {
30+
if (null !== $default && !\is_scalar($default) && !$default instanceof \Stringable) {
3131
throw new \InvalidArgumentException(sprintf('Excepted a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default)));
3232
}
3333

3434
$value = parent::get($key, $this);
3535

36-
if (null !== $value && $this !== $value && !is_scalar($value)) {
36+
if (null !== $value && $this !== $value && !\is_scalar($value)) {
3737
throw new BadRequestException(sprintf('Input value "%s" contains a non-scalar value.', $key));
3838
}
3939

@@ -66,7 +66,7 @@ public function add(array $inputs = [])
6666
*/
6767
public function set(string $key, mixed $value)
6868
{
69-
if (null !== $value && !is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) {
69+
if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) {
7070
throw new \InvalidArgumentException(sprintf('Excepted a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
7171
}
7272

Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public function overrideGlobals()
542542

543543
$request = ['g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE];
544544

545-
$requestOrder = ini_get('request_order') ?: ini_get('variables_order');
545+
$requestOrder = \ini_get('request_order') ?: \ini_get('variables_order');
546546
$requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';
547547

548548
$_REQUEST = [[]];

Session/Storage/Handler/AbstractSessionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
3131
public function open(string $savePath, string $sessionName): bool
3232
{
3333
$this->sessionName = $sessionName;
34-
if (!headers_sent() && !ini_get('session.cache_limiter') && '0' !== ini_get('session.cache_limiter')) {
35-
header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) ini_get('session.cache_expire')));
34+
if (!headers_sent() && !\ini_get('session.cache_limiter') && '0' !== \ini_get('session.cache_limiter')) {
35+
header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) \ini_get('session.cache_expire')));
3636
}
3737

3838
return true;
@@ -86,7 +86,7 @@ public function write(string $sessionId, string $data): bool
8686

8787
public function destroy(string $sessionId): bool
8888
{
89-
if (!headers_sent() && filter_var(ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOLEAN)) {
89+
if (!headers_sent() && filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOLEAN)) {
9090
if (!isset($this->sessionName)) {
9191
throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', static::class));
9292
}

Session/Storage/Handler/MemcachedSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function doRead(string $sessionId): string
6969

7070
public function updateTimestamp(string $sessionId, string $data): bool
7171
{
72-
$this->memcached->touch($this->prefix.$sessionId, time() + (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')));
72+
$this->memcached->touch($this->prefix.$sessionId, time() + (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')));
7373

7474
return true;
7575
}
@@ -79,7 +79,7 @@ public function updateTimestamp(string $sessionId, string $data): bool
7979
*/
8080
protected function doWrite(string $sessionId, string $data): bool
8181
{
82-
return $this->memcached->set($this->prefix.$sessionId, $data, time() + (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')));
82+
return $this->memcached->set($this->prefix.$sessionId, $data, time() + (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')));
8383
}
8484

8585
/**

Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function gc(int $maxlifetime): int|false
105105
*/
106106
protected function doWrite(string $sessionId, string $data): bool
107107
{
108-
$expiry = new UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
108+
$expiry = new UTCDateTime((time() + (int) \ini_get('session.gc_maxlifetime')) * 1000);
109109

110110
$fields = [
111111
$this->options['time_field'] => new UTCDateTime(),
@@ -124,7 +124,7 @@ protected function doWrite(string $sessionId, string $data): bool
124124

125125
public function updateTimestamp(string $sessionId, string $data): bool
126126
{
127-
$expiry = new UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
127+
$expiry = new UTCDateTime((time() + (int) \ini_get('session.gc_maxlifetime')) * 1000);
128128

129129
$this->getCollection()->updateOne(
130130
[$this->options['id_field'] => $sessionId],

Session/Storage/Handler/NativeFileSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NativeFileSessionHandler extends \SessionHandler
3131
public function __construct(string $savePath = null)
3232
{
3333
if (null === $savePath) {
34-
$savePath = ini_get('session.save_path');
34+
$savePath = \ini_get('session.save_path');
3535
}
3636

3737
$baseDir = $savePath;

Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected function doDestroy(string $sessionId): bool
286286
*/
287287
protected function doWrite(string $sessionId, string $data): bool
288288
{
289-
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
289+
$maxlifetime = (int) \ini_get('session.gc_maxlifetime');
290290

291291
try {
292292
// We use a single MERGE SQL query when supported by the database.
@@ -329,7 +329,7 @@ protected function doWrite(string $sessionId, string $data): bool
329329

330330
public function updateTimestamp(string $sessionId, string $data): bool
331331
{
332-
$expiry = time() + (int) ini_get('session.gc_maxlifetime');
332+
$expiry = time() + (int) \ini_get('session.gc_maxlifetime');
333333

334334
try {
335335
$updateStmt = $this->pdo->prepare(
@@ -603,7 +603,7 @@ protected function doRead(string $sessionId): string
603603
throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.');
604604
}
605605

606-
if (!filter_var(ini_get('session.use_strict_mode'), \FILTER_VALIDATE_BOOLEAN) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
606+
if (!filter_var(\ini_get('session.use_strict_mode'), \FILTER_VALIDATE_BOOLEAN) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
607607
// In strict mode, session fixation is not possible: new sessions always start with a unique
608608
// random id, so that concurrency is not possible and this code path can be skipped.
609609
// Exclusive-reading of non-existent rows does not block, so we need to do an insert to block
@@ -848,7 +848,7 @@ private function getMergeStatement(string $sessionId, string $data, int $maxlife
848848
protected function getConnection(): \PDO
849849
{
850850
if (!isset($this->pdo)) {
851-
$this->connect($this->dsn ?: ini_get('session.save_path'));
851+
$this->connect($this->dsn ?: \ini_get('session.save_path'));
852852
}
853853

854854
return $this->pdo;

Session/Storage/Handler/RedisSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function doRead(string $sessionId): string
6666
*/
6767
protected function doWrite(string $sessionId, string $data): bool
6868
{
69-
$result = $this->redis->setEx($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')), $data);
69+
$result = $this->redis->setEx($this->prefix.$sessionId, (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')), $data);
7070

7171
return $result && !$result instanceof ErrorInterface;
7272
}
@@ -109,6 +109,6 @@ public function gc(int $maxlifetime): int|false
109109

110110
public function updateTimestamp(string $sessionId, string $data): bool
111111
{
112-
return $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime')));
112+
return $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')));
113113
}
114114
}

Session/Storage/MetadataBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ private function stampCreated(int $lifetime = null): void
148148
{
149149
$timeStamp = time();
150150
$this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp;
151-
$this->meta[self::LIFETIME] = $lifetime ?? (int) ini_get('session.cookie_lifetime');
151+
$this->meta[self::LIFETIME] = $lifetime ?? (int) \ini_get('session.cookie_lifetime');
152152
}
153153
}

0 commit comments

Comments
 (0)