Skip to content

Commit 5af5017

Browse files
Merge branch '6.0' into 6.1
* 6.0: CS fixes Bump Symfony version to 6.0.11 Update VERSION for 6.0.10 Update CHANGELOG for 6.0.10 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 86119d2 + 9f9eb47 commit 5af5017

21 files changed

+46
-47
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-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
72+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
7373
$this->memcached->touch($this->prefix.$sessionId, time() + (int) $ttl);
7474

7575
return true;
@@ -80,7 +80,7 @@ public function updateTimestamp(string $sessionId, string $data): bool
8080
*/
8181
protected function doWrite(string $sessionId, string $data): bool
8282
{
83-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
83+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
8484

8585
return $this->memcached->set($this->prefix.$sessionId, $data, time() + (int) $ttl);
8686
}

Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function gc(int $maxlifetime): int|false
108108
*/
109109
protected function doWrite(string $sessionId, string $data): bool
110110
{
111-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
111+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
112112
$expiry = new UTCDateTime((time() + (int) $ttl) * 1000);
113113

114114
$fields = [
@@ -128,7 +128,7 @@ protected function doWrite(string $sessionId, string $data): bool
128128

129129
public function updateTimestamp(string $sessionId, string $data): bool
130130
{
131-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
131+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
132132
$expiry = new UTCDateTime((time() + (int) $ttl) * 1000);
133133

134134
$this->getCollection()->updateOne(

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
@@ -282,7 +282,7 @@ protected function doDestroy(string $sessionId): bool
282282
*/
283283
protected function doWrite(string $sessionId, string $data): bool
284284
{
285-
$maxlifetime = (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime'));
285+
$maxlifetime = (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'));
286286

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

326326
public function updateTimestamp(string $sessionId, string $data): bool
327327
{
328-
$expiry = time() + (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime'));
328+
$expiry = time() + (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'));
329329

330330
try {
331331
$updateStmt = $this->pdo->prepare(
@@ -599,7 +599,7 @@ protected function doRead(string $sessionId): string
599599
throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.');
600600
}
601601

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

850850
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-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
69+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
7070
$result = $this->redis->setEx($this->prefix.$sessionId, (int) $ttl, $data);
7171

7272
return $result && !$result instanceof ErrorInterface;
@@ -110,7 +110,7 @@ public function gc(int $maxlifetime): int|false
110110

111111
public function updateTimestamp(string $sessionId, string $data): bool
112112
{
113-
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? ini_get('session.gc_maxlifetime');
113+
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
114114

115115
return $this->redis->expire($this->prefix.$sessionId, (int) $ttl);
116116
}

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)