🔧
This commit is contained in:
4
vendor/symfony/http-foundation/File/File.php
vendored
4
vendor/symfony/http-foundation/File/File.php
vendored
@@ -82,7 +82,7 @@ class File extends \SplFileInfo
|
||||
*
|
||||
* @throws FileException if the target file could not be created
|
||||
*/
|
||||
public function move(string $directory, string $name = null): self
|
||||
public function move(string $directory, ?string $name = null): self
|
||||
{
|
||||
$target = $this->getTargetFile($directory, $name);
|
||||
|
||||
@@ -112,7 +112,7 @@ class File extends \SplFileInfo
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function getTargetFile(string $directory, string $name = null): self
|
||||
protected function getTargetFile(string $directory, ?string $name = null): self
|
||||
{
|
||||
if (!is_dir($directory)) {
|
||||
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
|
||||
|
||||
@@ -60,7 +60,7 @@ class UploadedFile extends File
|
||||
* @throws FileException If file_uploads is disabled
|
||||
* @throws FileNotFoundException If the file does not exist
|
||||
*/
|
||||
public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false)
|
||||
public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $error = null, bool $test = false)
|
||||
{
|
||||
$this->originalName = $this->getName($originalName);
|
||||
$this->mimeType = $mimeType ?: 'application/octet-stream';
|
||||
@@ -158,7 +158,7 @@ class UploadedFile extends File
|
||||
*
|
||||
* @throws FileException if, for any reason, the file could not have been moved
|
||||
*/
|
||||
public function move(string $directory, string $name = null): File
|
||||
public function move(string $directory, ?string $name = null): File
|
||||
{
|
||||
if ($this->isValid()) {
|
||||
if ($this->test) {
|
||||
|
||||
Reference in New Issue
Block a user