Skip to content

Commit f9c45b1

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents e3e5a62 + d01f322 commit f9c45b1

30 files changed

+113
-113
lines changed

ApacheRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\HttpFoundation;
1313

14-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ApacheRequest::class, Request::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ApacheRequest::class, Request::class), \E_USER_DEPRECATED);
1515

1616
/**
1717
* Request represents an HTTP request from an Apache server.

Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function create(string $name, string $value = null, $expire = 0, ?
9494
public function __construct(string $name, string $value = null, $expire = 0, ?string $path = '/', string $domain = null, ?bool $secure = false, bool $httpOnly = true, bool $raw = false, string $sameSite = null)
9595
{
9696
if (9 > \func_num_args()) {
97-
@trigger_error(sprintf('The default value of the "$secure" and "$samesite" arguments of "%s"\'s constructor will respectively change from "false" to "null" and from "null" to "lax" in Symfony 5.0, you should define their values explicitly or use "Cookie::create()" instead.', __METHOD__), E_USER_DEPRECATED);
97+
@trigger_error(sprintf('The default value of the "$secure" and "$samesite" arguments of "%s"\'s constructor will respectively change from "false" to "null" and from "null" to "lax" in Symfony 5.0, you should define their values explicitly or use "Cookie::create()" instead.', __METHOD__), \E_USER_DEPRECATED);
9898
}
9999

100100
// from PHP source code

File/MimeType/ExtensionGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Mime\MimeTypes;
1515

16-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', ExtensionGuesser::class, MimeTypes::class), E_USER_DEPRECATED);
16+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', ExtensionGuesser::class, MimeTypes::class), \E_USER_DEPRECATED);
1717

1818
/**
1919
* A singleton mime type to file extension guesser.

File/MimeType/FileBinaryMimeTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
1616
use Symfony\Component\Mime\FileBinaryMimeTypeGuesser as NewFileBinaryMimeTypeGuesser;
1717

18-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', FileBinaryMimeTypeGuesser::class, NewFileBinaryMimeTypeGuesser::class), E_USER_DEPRECATED);
18+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', FileBinaryMimeTypeGuesser::class, NewFileBinaryMimeTypeGuesser::class), \E_USER_DEPRECATED);
1919

2020
/**
2121
* Guesses the mime type with the binary "file" (only available on *nix).

File/MimeType/FileinfoMimeTypeGuesser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
1616
use Symfony\Component\Mime\FileinfoMimeTypeGuesser as NewFileinfoMimeTypeGuesser;
1717

18-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', FileinfoMimeTypeGuesser::class, NewFileinfoMimeTypeGuesser::class), E_USER_DEPRECATED);
18+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', FileinfoMimeTypeGuesser::class, NewFileinfoMimeTypeGuesser::class), \E_USER_DEPRECATED);
1919

2020
/**
2121
* Guesses the mime type using the PECL extension FileInfo.
@@ -65,7 +65,7 @@ public function guess($path)
6565
return null;
6666
}
6767

68-
if (!$finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) {
68+
if (!$finfo = new \finfo(\FILEINFO_MIME_TYPE, $this->magicFile)) {
6969
return null;
7070
}
7171
$mimeType = $finfo->file($path);

File/MimeType/MimeTypeExtensionGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Mime\MimeTypes;
1515

16-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', MimeTypeExtensionGuesser::class, MimeTypes::class), E_USER_DEPRECATED);
16+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', MimeTypeExtensionGuesser::class, MimeTypes::class), \E_USER_DEPRECATED);
1717

1818
/**
1919
* Provides a best-guess mapping of mime type to file extension.

File/MimeType/MimeTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
1616
use Symfony\Component\Mime\MimeTypes;
1717

18-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', MimeTypeGuesser::class, MimeTypes::class), E_USER_DEPRECATED);
18+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', MimeTypeGuesser::class, MimeTypes::class), \E_USER_DEPRECATED);
1919

2020
/**
2121
* A singleton mime type guesser.

File/UploadedFile.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ public function __construct(string $path, string $originalName, string $mimeType
6666
$this->mimeType = $mimeType ?: 'application/octet-stream';
6767

6868
if (4 < \func_num_args() ? !\is_bool($test) : null !== $error && @filesize($path) === $error) {
69-
@trigger_error(sprintf('Passing a size as 4th argument to the constructor of "%s" is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED);
69+
@trigger_error(sprintf('Passing a size as 4th argument to the constructor of "%s" is deprecated since Symfony 4.1.', __CLASS__), \E_USER_DEPRECATED);
7070
$error = $test;
7171
$test = 5 < \func_num_args() ? func_get_arg(5) : false;
7272
}
7373

74-
$this->error = $error ?: UPLOAD_ERR_OK;
74+
$this->error = $error ?: \UPLOAD_ERR_OK;
7575
$this->test = $test;
7676

77-
parent::__construct($path, UPLOAD_ERR_OK === $this->error);
77+
parent::__construct($path, \UPLOAD_ERR_OK === $this->error);
7878
}
7979

8080
/**
@@ -100,7 +100,7 @@ public function getClientOriginalName()
100100
*/
101101
public function getClientOriginalExtension()
102102
{
103-
return pathinfo($this->originalName, PATHINFO_EXTENSION);
103+
return pathinfo($this->originalName, \PATHINFO_EXTENSION);
104104
}
105105

106106
/**
@@ -155,7 +155,7 @@ public function guessClientExtension()
155155
*/
156156
public function getClientSize()
157157
{
158-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED);
158+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), \E_USER_DEPRECATED);
159159

160160
return $this->getSize();
161161
}
@@ -180,7 +180,7 @@ public function getError()
180180
*/
181181
public function isValid()
182182
{
183-
$isOk = UPLOAD_ERR_OK === $this->error;
183+
$isOk = \UPLOAD_ERR_OK === $this->error;
184184

185185
return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname());
186186
}
@@ -217,19 +217,19 @@ public function move($directory, $name = null)
217217
}
218218

219219
switch ($this->error) {
220-
case UPLOAD_ERR_INI_SIZE:
220+
case \UPLOAD_ERR_INI_SIZE:
221221
throw new IniSizeFileException($this->getErrorMessage());
222-
case UPLOAD_ERR_FORM_SIZE:
222+
case \UPLOAD_ERR_FORM_SIZE:
223223
throw new FormSizeFileException($this->getErrorMessage());
224-
case UPLOAD_ERR_PARTIAL:
224+
case \UPLOAD_ERR_PARTIAL:
225225
throw new PartialFileException($this->getErrorMessage());
226-
case UPLOAD_ERR_NO_FILE:
226+
case \UPLOAD_ERR_NO_FILE:
227227
throw new NoFileException($this->getErrorMessage());
228-
case UPLOAD_ERR_CANT_WRITE:
228+
case \UPLOAD_ERR_CANT_WRITE:
229229
throw new CannotWriteFileException($this->getErrorMessage());
230-
case UPLOAD_ERR_NO_TMP_DIR:
230+
case \UPLOAD_ERR_NO_TMP_DIR:
231231
throw new NoTmpDirFileException($this->getErrorMessage());
232-
case UPLOAD_ERR_EXTENSION:
232+
case \UPLOAD_ERR_EXTENSION:
233233
throw new ExtensionFileException($this->getErrorMessage());
234234
}
235235

@@ -246,7 +246,7 @@ public static function getMaxFilesize()
246246
$sizePostMax = self::parseFilesize(ini_get('post_max_size'));
247247
$sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));
248248

249-
return min($sizePostMax ?: PHP_INT_MAX, $sizeUploadMax ?: PHP_INT_MAX);
249+
return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX);
250250
}
251251

252252
/**
@@ -290,17 +290,17 @@ private static function parseFilesize($size): int
290290
public function getErrorMessage()
291291
{
292292
static $errors = [
293-
UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).',
294-
UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.',
295-
UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.',
296-
UPLOAD_ERR_NO_FILE => 'No file was uploaded.',
297-
UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.',
298-
UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',
299-
UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',
293+
\UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).',
294+
\UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.',
295+
\UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.',
296+
\UPLOAD_ERR_NO_FILE => 'No file was uploaded.',
297+
\UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.',
298+
\UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',
299+
\UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',
300300
];
301301

302302
$errorCode = $this->error;
303-
$maxFilesize = UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0;
303+
$maxFilesize = \UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0;
304304
$message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.';
305305

306306
return sprintf($message, $this->getClientOriginalName(), $maxFilesize);

FileBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function convertFileInformation($file)
8181
sort($keys);
8282

8383
if ($keys == self::$fileKeys) {
84-
if (UPLOAD_ERR_NO_FILE == $file['error']) {
84+
if (\UPLOAD_ERR_NO_FILE == $file['error']) {
8585
$file = null;
8686
} else {
8787
$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['error'], false);

HeaderBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function get($key, $default = null)
112112
{
113113
$headers = $this->all((string) $key);
114114
if (2 < \func_num_args()) {
115-
@trigger_error(sprintf('Passing a third argument to "%s()" is deprecated since Symfony 4.4, use method "all()" instead', __METHOD__), E_USER_DEPRECATED);
115+
@trigger_error(sprintf('Passing a third argument to "%s()" is deprecated since Symfony 4.4, use method "all()" instead', __METHOD__), \E_USER_DEPRECATED);
116116

117117
if (!func_get_arg(2)) {
118118
return $headers;
@@ -218,7 +218,7 @@ public function getDate($key, \DateTime $default = null)
218218
return $default;
219219
}
220220

221-
if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) {
221+
if (false === $date = \DateTime::createFromFormat(\DATE_RFC2822, $value)) {
222222
throw new \RuntimeException(sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value));
223223
}
224224

0 commit comments

Comments
 (0)