updated packages
This commit is contained in:
16
vendor/symfony/http-foundation/FileBag.php
vendored
16
vendor/symfony/http-foundation/FileBag.php
vendored
@@ -21,12 +21,12 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
*/
|
||||
class FileBag extends ParameterBag
|
||||
{
|
||||
private static $fileKeys = array('error', 'name', 'size', 'tmp_name', 'type');
|
||||
private static $fileKeys = ['error', 'name', 'size', 'tmp_name', 'type'];
|
||||
|
||||
/**
|
||||
* @param array $parameters An array of HTTP files
|
||||
*/
|
||||
public function __construct(array $parameters = array())
|
||||
public function __construct(array $parameters = [])
|
||||
{
|
||||
$this->replace($parameters);
|
||||
}
|
||||
@@ -34,9 +34,9 @@ class FileBag extends ParameterBag
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function replace(array $files = array())
|
||||
public function replace(array $files = [])
|
||||
{
|
||||
$this->parameters = array();
|
||||
$this->parameters = [];
|
||||
$this->add($files);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class FileBag extends ParameterBag
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function add(array $files = array())
|
||||
public function add(array $files = [])
|
||||
{
|
||||
foreach ($files as $key => $file) {
|
||||
$this->set($key, $file);
|
||||
@@ -87,7 +87,7 @@ class FileBag extends ParameterBag
|
||||
$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['error']);
|
||||
}
|
||||
} else {
|
||||
$file = array_map(array($this, 'convertFileInformation'), $file);
|
||||
$file = array_map([$this, 'convertFileInformation'], $file);
|
||||
if (array_keys($keys) === $keys) {
|
||||
$file = array_filter($file);
|
||||
}
|
||||
@@ -130,13 +130,13 @@ class FileBag extends ParameterBag
|
||||
}
|
||||
|
||||
foreach ($data['name'] as $key => $name) {
|
||||
$files[$key] = $this->fixPhpFilesArray(array(
|
||||
$files[$key] = $this->fixPhpFilesArray([
|
||||
'error' => $data['error'][$key],
|
||||
'name' => $name,
|
||||
'type' => $data['type'][$key],
|
||||
'tmp_name' => $data['tmp_name'][$key],
|
||||
'size' => $data['size'][$key],
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
return $files;
|
||||
|
||||
Reference in New Issue
Block a user