summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-foundation')
-rw-r--r--vendor/symfony/http-foundation/AcceptHeader.php2
-rw-r--r--vendor/symfony/http-foundation/AcceptHeaderItem.php4
-rw-r--r--vendor/symfony/http-foundation/BinaryFileResponse.php8
-rw-r--r--vendor/symfony/http-foundation/Cookie.php6
-rw-r--r--vendor/symfony/http-foundation/ExpressionRequestMatcher.php4
-rw-r--r--vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php2
-rw-r--r--vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php23
-rw-r--r--vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php2
-rw-r--r--vendor/symfony/http-foundation/File/UploadedFile.php4
-rw-r--r--vendor/symfony/http-foundation/FileBag.php16
-rw-r--r--vendor/symfony/http-foundation/HeaderBag.php18
-rw-r--r--vendor/symfony/http-foundation/HeaderUtils.php20
-rw-r--r--vendor/symfony/http-foundation/IpUtils.php4
-rw-r--r--vendor/symfony/http-foundation/JsonResponse.php12
-rw-r--r--vendor/symfony/http-foundation/ParameterBag.php12
-rw-r--r--vendor/symfony/http-foundation/RedirectResponse.php4
-rw-r--r--vendor/symfony/http-foundation/Request.php104
-rw-r--r--vendor/symfony/http-foundation/RequestMatcher.php16
-rw-r--r--vendor/symfony/http-foundation/RequestStack.php2
-rw-r--r--vendor/symfony/http-foundation/Response.php26
-rw-r--r--vendor/symfony/http-foundation/ResponseHeaderBag.php30
-rw-r--r--vendor/symfony/http-foundation/ServerBag.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php6
-rw-r--r--vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php14
-rw-r--r--vendor/symfony/http-foundation/Session/Flash/FlashBag.php8
-rw-r--r--vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Session.php2
-rw-r--r--vendor/symfony/http-foundation/Session/SessionUtils.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php6
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php36
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php12
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MetadataBag.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php10
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php22
-rw-r--r--vendor/symfony/http-foundation/StreamedResponse.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php54
-rw-r--r--vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php70
-rw-r--r--vendor/symfony/http-foundation/Tests/ApacheRequestTest.php52
-rw-r--r--vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php84
-rw-r--r--vendor/symfony/http-foundation/Tests/CookieTest.php22
-rw-r--r--vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php20
-rw-r--r--vendor/symfony/http-foundation/Tests/File/FileTest.php16
-rw-r--r--vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php20
-rw-r--r--vendor/symfony/http-foundation/Tests/FileBagTest.php110
-rw-r--r--vendor/symfony/http-foundation/Tests/HeaderBagTest.php54
-rw-r--r--vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php92
-rw-r--r--vendor/symfony/http-foundation/Tests/IpUtilsTest.php66
-rw-r--r--vendor/symfony/http-foundation/Tests/JsonResponseTest.php38
-rw-r--r--vendor/symfony/http-foundation/Tests/ParameterBagTest.php72
-rw-r--r--vendor/symfony/http-foundation/Tests/RedirectResponseTest.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/RequestMatcherTest.php44
-rw-r--r--vendor/symfony/http-foundation/Tests/RequestTest.php844
-rw-r--r--vendor/symfony/http-foundation/Tests/ResponseFunctionalTest.php10
-rw-r--r--vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php66
-rw-r--r--vendor/symfony/http-foundation/Tests/ResponseTest.php116
-rw-r--r--vendor/symfony/http-foundation/Tests/ServerBagTest.php66
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php48
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php62
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php70
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php64
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/SessionTest.php26
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php12
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php12
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php20
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php18
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php14
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php34
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisSessionHandlerTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/RedisArraySessionHandlerTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php18
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php20
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php2
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php18
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php4
-rw-r--r--vendor/symfony/http-foundation/Tests/StreamedResponseTest.php6
85 files changed, 1433 insertions, 1422 deletions
diff --git a/vendor/symfony/http-foundation/AcceptHeader.php b/vendor/symfony/http-foundation/AcceptHeader.php
index c702371f81..3f5fbb8f3b 100644
--- a/vendor/symfony/http-foundation/AcceptHeader.php
+++ b/vendor/symfony/http-foundation/AcceptHeader.php
@@ -24,7 +24,7 @@ class AcceptHeader
/**
* @var AcceptHeaderItem[]
*/
- private $items = array();
+ private $items = [];
/**
* @var bool
diff --git a/vendor/symfony/http-foundation/AcceptHeaderItem.php b/vendor/symfony/http-foundation/AcceptHeaderItem.php
index 2aaf59579f..954aac6014 100644
--- a/vendor/symfony/http-foundation/AcceptHeaderItem.php
+++ b/vendor/symfony/http-foundation/AcceptHeaderItem.php
@@ -21,9 +21,9 @@ class AcceptHeaderItem
private $value;
private $quality = 1.0;
private $index = 0;
- private $attributes = array();
+ private $attributes = [];
- public function __construct(string $value, array $attributes = array())
+ public function __construct(string $value, array $attributes = [])
{
$this->value = $value;
foreach ($attributes as $name => $value) {
diff --git a/vendor/symfony/http-foundation/BinaryFileResponse.php b/vendor/symfony/http-foundation/BinaryFileResponse.php
index 07ef800508..115f486f02 100644
--- a/vendor/symfony/http-foundation/BinaryFileResponse.php
+++ b/vendor/symfony/http-foundation/BinaryFileResponse.php
@@ -44,7 +44,7 @@ class BinaryFileResponse extends Response
* @param bool $autoEtag Whether the ETag header should be automatically set
* @param bool $autoLastModified Whether the Last-Modified header should be automatically set
*/
- public function __construct($file, int $status = 200, array $headers = array(), bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true)
+ public function __construct($file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true)
{
parent::__construct(null, $status, $headers);
@@ -66,7 +66,7 @@ class BinaryFileResponse extends Response
*
* @return static
*/
- public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
+ public static function create($file = null, $status = 200, $headers = [], $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
return new static($file, $status, $headers, $public, $contentDisposition, $autoEtag, $autoLastModified);
}
@@ -234,7 +234,7 @@ class BinaryFileResponse extends Response
if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) {
$range = $request->headers->get('Range');
- list($start, $end) = explode('-', substr($range, 6), 2) + array(0);
+ list($start, $end) = explode('-', substr($range, 6), 2) + [0];
$end = ('' === $end) ? $fileSize - 1 : (int) $end;
@@ -300,7 +300,7 @@ class BinaryFileResponse extends Response
fclose($out);
fclose($file);
- if ($this->deleteFileAfterSend) {
+ if ($this->deleteFileAfterSend && file_exists($this->file->getPathname())) {
unlink($this->file->getPathname());
}
diff --git a/vendor/symfony/http-foundation/Cookie.php b/vendor/symfony/http-foundation/Cookie.php
index 7aab318ccd..0ba6037d7c 100644
--- a/vendor/symfony/http-foundation/Cookie.php
+++ b/vendor/symfony/http-foundation/Cookie.php
@@ -42,7 +42,7 @@ class Cookie
*/
public static function fromString($cookie, $decode = false)
{
- $data = array(
+ $data = [
'expires' => 0,
'path' => '/',
'domain' => null,
@@ -50,7 +50,7 @@ class Cookie
'httponly' => false,
'raw' => !$decode,
'samesite' => null,
- );
+ ];
$parts = HeaderUtils::split($cookie, ';=');
$part = array_shift($parts);
@@ -126,7 +126,7 @@ class Cookie
$sameSite = strtolower($sameSite);
}
- if (!\in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) {
+ if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, null], true)) {
throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
}
diff --git a/vendor/symfony/http-foundation/ExpressionRequestMatcher.php b/vendor/symfony/http-foundation/ExpressionRequestMatcher.php
index e9c8441ce3..26bed7d371 100644
--- a/vendor/symfony/http-foundation/ExpressionRequestMatcher.php
+++ b/vendor/symfony/http-foundation/ExpressionRequestMatcher.php
@@ -35,13 +35,13 @@ class ExpressionRequestMatcher extends RequestMatcher
throw new \LogicException('Unable to match the request as the expression language is not available.');
}
- return $this->language->evaluate($this->expression, array(
+ return $this->language->evaluate($this->expression, [
'request' => $request,
'method' => $request->getMethod(),
'path' => rawurldecode($request->getPathInfo()),
'host' => $request->getHost(),
'ip' => $request->getClientIp(),
'attributes' => $request->attributes->all(),
- )) && parent::matches($request);
+ ]) && parent::matches($request);
}
}
diff --git a/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php b/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php
index 263fb321c5..80f4d47f76 100644
--- a/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php
+++ b/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php
@@ -37,7 +37,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface
*
* @var array
*/
- protected $guessers = array();
+ protected $guessers = [];
/**
* Returns the singleton instance.
diff --git a/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php b/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php
index 77bf51b1e5..d5acb34094 100644
--- a/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php
+++ b/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php
@@ -20,11 +20,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
* A map of mime types and their default extensions.
*
* This list has been placed under the public domain by the Apache HTTPD project.
- * This list has been updated from upstream on 2013-04-23.
+ * This list has been updated from upstream on 2019-01-14.
*
- * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+ * @see https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
*/
- protected $defaultExtensions = array(
+ protected $defaultExtensions = [
'application/andrew-inset' => 'ez',
'application/applixware' => 'aw',
'application/atom+xml' => 'atom',
@@ -618,7 +618,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'audio/adpcm' => 'adp',
'audio/basic' => 'au',
'audio/midi' => 'mid',
- 'audio/mp4' => 'mp4a',
+ 'audio/mp4' => 'm4a',
'audio/mpeg' => 'mpga',
'audio/ogg' => 'oga',
'audio/s3m' => 's3m',
@@ -653,6 +653,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'chemical/x-cml' => 'cml',
'chemical/x-csml' => 'csml',
'chemical/x-xyz' => 'xyz',
+ 'font/collection' => 'ttc',
+ 'font/otf' => 'otf',
+ 'font/ttf' => 'ttf',
+ 'font/woff' => 'woff',
+ 'font/woff2' => 'woff2',
'image/bmp' => 'bmp',
'image/x-ms-bmp' => 'bmp',
'image/cgm' => 'cgm',
@@ -669,8 +674,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'image/tiff' => 'tiff',
'image/vnd.adobe.photoshop' => 'psd',
'image/vnd.dece.graphic' => 'uvi',
- 'image/vnd.dvb.subtitle' => 'sub',
'image/vnd.djvu' => 'djvu',
+ 'image/vnd.dvb.subtitle' => 'sub',
'image/vnd.dwg' => 'dwg',
'image/vnd.dxf' => 'dxf',
'image/vnd.fastbidsheet' => 'fbs',
@@ -732,8 +737,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'text/vcard' => 'vcard',
'text/vnd.curl' => 'curl',
'text/vnd.curl.dcurl' => 'dcurl',
- 'text/vnd.curl.scurl' => 'scurl',
'text/vnd.curl.mcurl' => 'mcurl',
+ 'text/vnd.curl.scurl' => 'scurl',
'text/vnd.dvb.subtitle' => 'sub',
'text/vnd.fly' => 'fly',
'text/vnd.fmi.flexstor' => 'flx',
@@ -747,10 +752,10 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'text/x-asm' => 's',
'text/x-c' => 'c',
'text/x-fortran' => 'f',
- 'text/x-pascal' => 'p',
'text/x-java-source' => 'java',
- 'text/x-opml' => 'opml',
'text/x-nfo' => 'nfo',
+ 'text/x-opml' => 'opml',
+ 'text/x-pascal' => 'p',
'text/x-setext' => 'etx',
'text/x-sfv' => 'sfv',
'text/x-uuencode' => 'uu',
@@ -796,7 +801,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
'video/x-sgi-movie' => 'movie',
'video/x-smv' => 'smv',
'x-conference/x-cooltalk' => 'ice',
- );
+ ];
/**
* {@inheritdoc}
diff --git a/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php b/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php
index dae47a7c02..95d1ee2676 100644
--- a/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php
+++ b/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php
@@ -51,7 +51,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
*
* @var array
*/
- protected $guessers = array();
+ protected $guessers = [];
/**
* Returns the singleton instance.
diff --git a/vendor/symfony/http-foundation/File/UploadedFile.php b/vendor/symfony/http-foundation/File/UploadedFile.php
index 63fa6c7302..efe00d64cc 100644
--- a/vendor/symfony/http-foundation/File/UploadedFile.php
+++ b/vendor/symfony/http-foundation/File/UploadedFile.php
@@ -281,7 +281,7 @@ class UploadedFile extends File
*/
public function getErrorMessage()
{
- static $errors = array(
+ static $errors = [
UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).',
UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.',
UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.',
@@ -289,7 +289,7 @@ class UploadedFile extends File
UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.',
UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',
UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',
- );
+ ];
$errorCode = $this->error;
$maxFilesize = UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0;
diff --git a/vendor/symfony/http-foundation/FileBag.php b/vendor/symfony/http-foundation/FileBag.php
index f37e10f204..14fbc7aa9d 100644
--- a/vendor/symfony/http-foundation/FileBag.php
+++ b/vendor/symfony/http-foundation/FileBag.php
@@ -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;
diff --git a/vendor/symfony/http-foundation/HeaderBag.php b/vendor/symfony/http-foundation/HeaderBag.php
index 8f51ef9dba..b37a72e47e 100644
--- a/vendor/symfony/http-foundation/HeaderBag.php
+++ b/vendor/symfony/http-foundation/HeaderBag.php
@@ -18,13 +18,13 @@ namespace Symfony\Component\HttpFoundation;
*/
class HeaderBag implements \IteratorAggregate, \Countable
{
- protected $headers = array();
- protected $cacheControl = array();
+ protected $headers = [];
+ protected $cacheControl = [];
/**
* @param array $headers An array of HTTP headers
*/
- public function __construct(array $headers = array())
+ public function __construct(array $headers = [])
{
foreach ($headers as $key => $values) {
$this->set($key, $values);
@@ -80,9 +80,9 @@ class HeaderBag implements \IteratorAggregate, \Countable
*
* @param array $headers An array of HTTP headers
*/
- public function replace(array $headers = array())
+ public function replace(array $headers = [])
{
- $this->headers = array();
+ $this->headers = [];
$this->add($headers);
}
@@ -114,10 +114,10 @@ class HeaderBag implements \IteratorAggregate, \Countable
if (!array_key_exists($key, $headers)) {
if (null === $default) {
- return $first ? null : array();
+ return $first ? null : [];
}
- return $first ? $default : array($default);
+ return $first ? $default : [$default];
}
if ($first) {
@@ -148,7 +148,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
}
} else {
if (true === $replace || !isset($this->headers[$key])) {
- $this->headers[$key] = array($values);
+ $this->headers[$key] = [$values];
} else {
$this->headers[$key][] = $values;
}
@@ -196,7 +196,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
unset($this->headers[$key]);
if ('cache-control' === $key) {
- $this->cacheControl = array();
+ $this->cacheControl = [];
}
}
diff --git a/vendor/symfony/http-foundation/HeaderUtils.php b/vendor/symfony/http-foundation/HeaderUtils.php
index 637bc5be47..31db1bd0de 100644
--- a/vendor/symfony/http-foundation/HeaderUtils.php
+++ b/vendor/symfony/http-foundation/HeaderUtils.php
@@ -34,7 +34,7 @@ class HeaderUtils
* Example:
*
* HeaderUtils::split("da, en-gb;q=0.8", ",;")
- * // => array(array('da'), array('en-gb', 'q=0.8'))
+ * // => ['da'], ['en-gb', 'q=0.8']]
*
* @param string $header HTTP header value
* @param string $separators List of characters to split on, ordered by
@@ -78,12 +78,12 @@ class HeaderUtils
*
* Example:
*
- * HeaderUtils::combine(array(array("foo", "abc"), array("bar")))
- * // => array("foo" => "abc", "bar" => true)
+ * HeaderUtils::combine([["foo", "abc"], ["bar"]])
+ * // => ["foo" => "abc", "bar" => true]
*/
public static function combine(array $parts): array
{
- $assoc = array();
+ $assoc = [];
foreach ($parts as $part) {
$name = strtolower($part[0]);
$value = $part[1] ?? true;
@@ -102,12 +102,12 @@ class HeaderUtils
*
* Example:
*
- * HeaderUtils::toString(array("foo" => "abc", "bar" => true, "baz" => "a b c"), ",")
+ * HeaderUtils::toString(["foo" => "abc", "bar" => true, "baz" => "a b c"], ",")
* // => 'foo=abc, bar, baz="a b c"'
*/
public static function toString(array $assoc, string $separator): string
{
- $parts = array();
+ $parts = [];
foreach ($assoc as $name => $value) {
if (true === $value) {
$parts[] = $name;
@@ -163,7 +163,7 @@ class HeaderUtils
*/
public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
{
- if (!\in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) {
+ if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
}
@@ -186,7 +186,7 @@ class HeaderUtils
throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.');
}
- $params = array('filename' => $filenameFallback);
+ $params = ['filename' => $filenameFallback];
if ($filename !== $filenameFallback) {
$params['filename*'] = "utf-8''".rawurlencode($filename);
}
@@ -200,7 +200,7 @@ class HeaderUtils
$partSeparators = substr($separators, 1);
$i = 0;
- $partMatches = array();
+ $partMatches = [];
foreach ($matches as $match) {
if (isset($match['separator']) && $match['separator'] === $separator) {
++$i;
@@ -209,7 +209,7 @@ class HeaderUtils
}
}
- $parts = array();
+ $parts = [];
if ($partSeparators) {
foreach ($partMatches as $matches) {
$parts[] = self::groupParts($matches, $partSeparators);
diff --git a/vendor/symfony/http-foundation/IpUtils.php b/vendor/symfony/http-foundation/IpUtils.php
index a1bfa90885..67d13e57aa 100644
--- a/vendor/symfony/http-foundation/IpUtils.php
+++ b/vendor/symfony/http-foundation/IpUtils.php
@@ -18,7 +18,7 @@ namespace Symfony\Component\HttpFoundation;
*/
class IpUtils
{
- private static $checkedIps = array();
+ private static $checkedIps = [];
/**
* This class should not be instantiated.
@@ -38,7 +38,7 @@ class IpUtils
public static function checkIp($requestIp, $ips)
{
if (!\is_array($ips)) {
- $ips = array($ips);
+ $ips = [$ips];
}
$method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';
diff --git a/vendor/symfony/http-foundation/JsonResponse.php b/vendor/symfony/http-foundation/JsonResponse.php
index f10262e88e..817cbb9afc 100644
--- a/vendor/symfony/http-foundation/JsonResponse.php
+++ b/vendor/symfony/http-foundation/JsonResponse.php
@@ -39,7 +39,7 @@ class JsonResponse extends Response
* @param array $headers An array of response headers
* @param bool $json If the data is already a JSON string
*/
- public function __construct($data = null, int $status = 200, array $headers = array(), bool $json = false)
+ public function __construct($data = null, int $status = 200, array $headers = [], bool $json = false)
{
parent::__construct('', $status, $headers);
@@ -64,7 +64,7 @@ class JsonResponse extends Response
*
* @return static
*/
- public static function create($data = null, $status = 200, $headers = array())
+ public static function create($data = null, $status = 200, $headers = [])
{
return new static($data, $status, $headers);
}
@@ -72,7 +72,7 @@ class JsonResponse extends Response
/**
* Make easier the creation of JsonResponse from raw json.
*/
- public static function fromJsonString($data = null, $status = 200, $headers = array())
+ public static function fromJsonString($data = null, $status = 200, $headers = [])
{
return new static($data, $status, $headers, true);
}
@@ -94,11 +94,11 @@ class JsonResponse extends Response
// JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details.
// (c) William Durand <william.durand1@gmail.com>
$pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u';
- $reserved = array(
+ $reserved = [
'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while',
'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export',
'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false',
- );
+ ];
$parts = explode('.', $callback);
foreach ($parts as $part) {
if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) {
@@ -137,7 +137,7 @@ class JsonResponse extends Response
*
* @throws \InvalidArgumentException
*/
- public function setData($data = array())
+ public function setData($data = [])
{
try {
$data = json_encode($data, $this->encodingOptions);
diff --git a/vendor/symfony/http-foundation/ParameterBag.php b/vendor/symfony/http-foundation/ParameterBag.php
index 19d7ee913a..3c6ba46a6a 100644
--- a/vendor/symfony/http-foundation/ParameterBag.php
+++ b/vendor/symfony/http-foundation/ParameterBag.php
@@ -26,7 +26,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
/**
* @param array $parameters An array of parameters
*/
- public function __construct(array $parameters = array())
+ public function __construct(array $parameters = [])
{
$this->parameters = $parameters;
}
@@ -56,7 +56,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
*
* @param array $parameters An array of parameters
*/
- public function replace(array $parameters = array())
+ public function replace(array $parameters = [])
{
$this->parameters = $parameters;
}
@@ -66,7 +66,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
*
* @param array $parameters An array of parameters
*/
- public function add(array $parameters = array())
+ public function add(array $parameters = [])
{
$this->parameters = array_replace($this->parameters, $parameters);
}
@@ -154,7 +154,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
public function getDigits($key, $default = '')
{
// we need to remove - and + because they're allowed in the filter
- return str_replace(array('-', '+'), '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT));
+ return str_replace(['-', '+'], '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT));
}
/**
@@ -195,13 +195,13 @@ class ParameterBag implements \IteratorAggregate, \Countable
*
* @return mixed
*/
- public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array())
+ public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = [])
{
$value = $this->get($key, $default);
// Always turn $options into an array - this allows filter_var option shortcuts.
if (!\is_array($options) && $options) {
- $options = array('flags' => $options);
+ $options = ['flags' => $options];
}
// Add a convenience check for arrays.
diff --git a/vendor/symfony/http-foundation/RedirectResponse.php b/vendor/symfony/http-foundation/RedirectResponse.php
index 11f71a0342..22e5fbb2d0 100644
--- a/vendor/symfony/http-foundation/RedirectResponse.php
+++ b/vendor/symfony/http-foundation/RedirectResponse.php
@@ -32,7 +32,7 @@ class RedirectResponse extends Response
*
* @see http://tools.ietf.org/html/rfc2616#section-10.3
*/
- public function __construct(?string $url, int $status = 302, array $headers = array())
+ public function __construct(?string $url, int $status = 302, array $headers = [])
{
parent::__construct('', $status, $headers);
@@ -56,7 +56,7 @@ class RedirectResponse extends Response
*
* @return static
*/
- public static function create($url = '', $status = 302, $headers = array())
+ public static function create($url = '', $status = 302, $headers = [])
{
return new static($url, $status, $headers);
}
diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php
index c13016e522..7f44aab1d5 100644
--- a/vendor/symfony/http-foundation/Request.php
+++ b/vendor/symfony/http-foundation/Request.php
@@ -52,17 +52,17 @@ class Request
/**
* @var string[]
*/
- protected static $trustedProxies = array();
+ protected static $trustedProxies = [];
/**
* @var string[]
*/
- protected static $trustedHostPatterns = array();
+ protected static $trustedHostPatterns = [];
/**
* @var string[]
*/
- protected static $trustedHosts = array();
+ protected static $trustedHosts = [];
protected static $httpMethodParameterOverride = false;
@@ -197,12 +197,12 @@ class Request
private static $trustedHeaderSet = -1;
- private static $forwardedParams = array(
+ private static $forwardedParams = [
self::HEADER_X_FORWARDED_FOR => 'for',
self::HEADER_X_FORWARDED_HOST => 'host',
self::HEADER_X_FORWARDED_PROTO => 'proto',
self::HEADER_X_FORWARDED_PORT => 'host',
- );
+ ];
/**
* Names for headers that can be trusted when
@@ -213,13 +213,13 @@ class Request
* The other headers are non-standard, but widely used
* by popular reverse proxies (like Apache mod_proxy or Amazon EC2).
*/
- private static $trustedHeaders = array(
+ private static $trustedHeaders = [
self::HEADER_FORWARDED => 'FORWARDED',
self::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
self::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
self::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
self::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
- );
+ ];
/**
* @param array $query The GET parameters
@@ -230,7 +230,7 @@ class Request
* @param array $server The SERVER parameters
* @param string|resource|null $content The raw body data
*/
- public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+ public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
}
@@ -248,7 +248,7 @@ class Request
* @param array $server The SERVER parameters
* @param string|resource|null $content The raw body data
*/
- public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+ public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
$this->request = new ParameterBag($request);
$this->query = new ParameterBag($query);
@@ -278,10 +278,10 @@ class Request
*/
public static function createFromGlobals()
{
- $request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
+ $request = self::createRequestFromFactory($_GET, $_POST, [], $_COOKIE, $_FILES, $_SERVER);
if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
- && \in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
+ && \in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'DELETE', 'PATCH'])
) {
parse_str($request->getContent(), $data);
$request->request = new ParameterBag($data);
@@ -306,9 +306,9 @@ class Request
*
* @return static
*/
- public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
+ public static function create($uri, $method = 'GET', $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
{
- $server = array_replace(array(
+ $server = array_replace([
'SERVER_NAME' => 'localhost',
'SERVER_PORT' => 80,
'HTTP_HOST' => 'localhost',
@@ -321,7 +321,7 @@ class Request
'SCRIPT_FILENAME' => '',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'REQUEST_TIME' => time(),
- ), $server);
+ ], $server);
$server['PATH_INFO'] = '';
$server['REQUEST_METHOD'] = strtoupper($method);
@@ -369,10 +369,10 @@ class Request
// no break
case 'PATCH':
$request = $parameters;
- $query = array();
+ $query = [];
break;
default:
- $request = array();
+ $request = [];
$query = $parameters;
break;
}
@@ -395,7 +395,7 @@ class Request
$server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : '');
$server['QUERY_STRING'] = $queryString;
- return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
+ return self::createRequestFromFactory($query, $request, [], $cookies, $files, $server, $content);
}
/**
@@ -499,7 +499,7 @@ class Request
}
$cookieHeader = '';
- $cookies = array();
+ $cookies = [];
foreach ($this->cookies as $k => $v) {
$cookies[] = $k.'='.$v;
@@ -533,19 +533,19 @@ class Request
foreach ($this->headers->all() as $key => $value) {
$key = strtoupper(str_replace('-', '_', $key));
- if (\in_array($key, array('CONTENT_TYPE', 'CONTENT_LENGTH'))) {
+ if (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) {
$_SERVER[$key] = implode(', ', $value);
} else {
$_SERVER['HTTP_'.$key] = implode(', ', $value);
}
}
- $request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE);
+ $request = ['g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE];
$requestOrder = ini_get('request_order') ?: ini_get('variables_order');
$requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';
- $_REQUEST = array(array());
+ $_REQUEST = [[]];
foreach (str_split($requestOrder) as $order) {
$_REQUEST[] = $request[$order];
@@ -603,7 +603,7 @@ class Request
return sprintf('{%s}i', $hostPattern);
}, $hostPatterns);
// we need to reset trusted hosts on trusted host patterns change
- self::$trustedHosts = array();
+ self::$trustedHosts = [];
}
/**
@@ -777,10 +777,10 @@ class Request
$ip = $this->server->get('REMOTE_ADDR');
if (!$this->isFromTrustedProxy()) {
- return array($ip);
+ return [$ip];
}
- return $this->getTrustedValues(self::HEADER_X_FORWARDED_FOR, $ip) ?: array($ip);
+ return $this->getTrustedValues(self::HEADER_X_FORWARDED_FOR, $ip) ?: [$ip];
}
/**
@@ -1114,7 +1114,7 @@ class Request
public function isSecure()
{
if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_X_FORWARDED_PROTO)) {
- return \in_array(strtolower($proto[0]), array('https', 'on', 'ssl', '1'), true);
+ return \in_array(strtolower($proto[0]), ['https', 'on', 'ssl', '1'], true);
}
$https = $this->server->get('HTTPS');
@@ -1273,7 +1273,7 @@ class Request
static::initializeFormats();
}
- return isset(static::$formats[$format]) ? static::$formats[$format] : array();
+ return isset(static::$formats[$format]) ? static::$formats[$format] : [];
}
/**
@@ -1316,7 +1316,7 @@ class Request
static::initializeFormats();
}
- static::$formats[$format] = \is_array($mimeTypes) ? $mimeTypes : array($mimeTypes);
+ static::$formats[$format] = \is_array($mimeTypes) ? $mimeTypes : [$mimeTypes];
}
/**
@@ -1433,7 +1433,7 @@ class Request
throw new \BadMethodCallException('Checking only for cacheable HTTP methods with Symfony\Component\HttpFoundation\Request::isMethodSafe() is not supported.');
}
- return \in_array($this->getMethod(), array('GET', 'HEAD', 'OPTIONS', 'TRACE'));
+ return \in_array($this->getMethod(), ['GET', 'HEAD', 'OPTIONS', 'TRACE']);
}
/**
@@ -1443,7 +1443,7 @@ class Request
*/
public function isMethodIdempotent()
{
- return \in_array($this->getMethod(), array('HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE'));
+ return \in_array($this->getMethod(), ['HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE']);
}
/**
@@ -1455,7 +1455,7 @@ class Request
*/
public function isMethodCacheable()
{
- return \in_array($this->getMethod(), array('GET', 'HEAD'));
+ return \in_array($this->getMethod(), ['GET', 'HEAD']);
}
/**
@@ -1566,7 +1566,7 @@ class Request
return $locales[0];
}
- $extendedPreferredLanguages = array();
+ $extendedPreferredLanguages = [];
foreach ($preferredLanguages as $language) {
$extendedPreferredLanguages[] = $language;
if (false !== $position = strpos($language, '_')) {
@@ -1594,7 +1594,7 @@ class Request
}
$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all();
- $this->languages = array();
+ $this->languages = [];
foreach ($languages as $lang => $acceptHeaderItem) {
if (false !== strpos($lang, '-')) {
$codes = explode('-', $lang);
@@ -1864,19 +1864,19 @@ class Request
*/
protected static function initializeFormats()
{
- static::$formats = array(
- 'html' => array('text/html', 'application/xhtml+xml'),
- 'txt' => array('text/plain'),
- 'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'),
- 'css' => array('text/css'),
- 'json' => array('application/json', 'application/x-json'),
- 'jsonld' => array('application/ld+json'),
- 'xml' => array('text/xml', 'application/xml', 'application/x-xml'),
- 'rdf' => array('application/rdf+xml'),
- 'atom' => array('application/atom+xml'),
- 'rss' => array('application/rss+xml'),
- 'form' => array('application/x-www-form-urlencoded'),
- );
+ static::$formats = [
+ 'html' => ['text/html', 'application/xhtml+xml'],
+ 'txt' => ['text/plain'],
+ 'js' => ['application/javascript', 'application/x-javascript', 'text/javascript'],
+ 'css' => ['text/css'],
+ 'json' => ['application/json', 'application/x-json'],
+ 'jsonld' => ['application/ld+json'],
+ 'xml' => ['text/xml', 'application/xml', 'application/x-xml'],
+ 'rdf' => ['application/rdf+xml'],
+ 'atom' => ['application/atom+xml'],
+ 'rss' => ['application/rss+xml'],
+ 'form' => ['application/x-www-form-urlencoded'],
+ ];
}
private function setPhpDefaultLocale(string $locale)
@@ -1913,7 +1913,7 @@ class Request
return false;
}
- private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+ private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
if (self::$requestFactory) {
$request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content);
@@ -1943,8 +1943,8 @@ class Request
private function getTrustedValues($type, $ip = null)
{
- $clientValues = array();
- $forwardedValues = array();
+ $clientValues = [];
+ $forwardedValues = [];
if ((self::$trustedHeaderSet & $type) && $this->headers->has(self::$trustedHeaders[$type])) {
foreach (explode(',', $this->headers->get(self::$trustedHeaders[$type])) as $v) {
@@ -1955,7 +1955,7 @@ class Request
if ((self::$trustedHeaderSet & self::HEADER_FORWARDED) && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) {
$forwarded = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]);
$parts = HeaderUtils::split($forwarded, ',;=');
- $forwardedValues = array();
+ $forwardedValues = [];
$param = self::$forwardedParams[$type];
foreach ($parts as $subParts) {
if (null === $v = HeaderUtils::combine($subParts)[$param] ?? null) {
@@ -1985,7 +1985,7 @@ class Request
}
if (!$this->isForwardedValid) {
- return null !== $ip ? array('0.0.0.0', $ip) : array();
+ return null !== $ip ? ['0.0.0.0', $ip] : [];
}
$this->isForwardedValid = false;
@@ -1995,7 +1995,7 @@ class Request
private function normalizeAndFilterClientIps(array $clientIps, $ip)
{
if (!$clientIps) {
- return array();
+ return [];
}
$clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from
$firstTrustedIp = null;
@@ -2031,6 +2031,6 @@ class Request
}
// Now the IP chain contains only untrusted proxies and the client IP
- return $clientIps ? array_reverse($clientIps) : array($firstTrustedIp);
+ return $clientIps ? array_reverse($clientIps) : [$firstTrustedIp];
}
}
diff --git a/vendor/symfony/http-foundation/RequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher.php
index ab9434f43f..d79c7f2ea2 100644
--- a/vendor/symfony/http-foundation/RequestMatcher.php
+++ b/vendor/symfony/http-foundation/RequestMatcher.php
@@ -36,22 +36,22 @@ class RequestMatcher implements RequestMatcherInterface
/**
* @var string[]
*/
- private $methods = array();
+ private $methods = [];
/**
* @var string[]
*/
- private $ips = array();
+ private $ips = [];
/**
* @var array
*/
- private $attributes = array();
+ private $attributes = [];
/**
* @var string[]
*/
- private $schemes = array();
+ private $schemes = [];
/**
* @param string|null $path
@@ -61,7 +61,7 @@ class RequestMatcher implements RequestMatcherInterface
* @param array $attributes
* @param string|string[]|null $schemes
*/
- public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = array(), $schemes = null, int $port = null)
+ public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, int $port = null)
{
$this->matchPath($path);
$this->matchHost($host);
@@ -82,7 +82,7 @@ class RequestMatcher implements RequestMatcherInterface
*/
public function matchScheme($scheme)
{
- $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : array();
+ $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : [];
}
/**
@@ -132,7 +132,7 @@ class RequestMatcher implements RequestMatcherInterface
*/
public function matchIps($ips)
{
- $this->ips = null !== $ips ? (array) $ips : array();
+ $this->ips = null !== $ips ? (array) $ips : [];
}
/**
@@ -142,7 +142,7 @@ class RequestMatcher implements RequestMatcherInterface
*/
public function matchMethod($method)
{
- $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : array();
+ $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : [];
}
/**
diff --git a/vendor/symfony/http-foundation/RequestStack.php b/vendor/symfony/http-foundation/RequestStack.php
index 40123f66f9..885d78a50e 100644
--- a/vendor/symfony/http-foundation/RequestStack.php
+++ b/vendor/symfony/http-foundation/RequestStack.php
@@ -21,7 +21,7 @@ class RequestStack
/**
* @var Request[]
*/
- private $requests = array();
+ private $requests = [];
/**
* Pushes a Request on the stack.
diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php
index 7c96212603..26b3f209d5 100644
--- a/vendor/symfony/http-foundation/Response.php
+++ b/vendor/symfony/http-foundation/Response.php
@@ -128,7 +128,7 @@ class Response
*
* @var array
*/
- public static $statusTexts = array(
+ public static $statusTexts = [
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // RFC2518
@@ -191,12 +191,12 @@ class Response
508 => 'Loop Detected', // RFC5842
510 => 'Not Extended', // RFC2774
511 => 'Network Authentication Required', // RFC6585
- );
+ ];
/**
* @throws \InvalidArgumentException When the HTTP status code is not valid
*/
- public function __construct($content = '', int $status = 200, array $headers = array())
+ public function __construct($content = '', int $status = 200, array $headers = [])
{
$this->headers = new ResponseHeaderBag($headers);
$this->setContent($content);
@@ -218,7 +218,7 @@ class Response
*
* @return static
*/
- public static function create($content = '', $status = 200, $headers = array())
+ public static function create($content = '', $status = 200, $headers = [])
{
return new static($content, $status, $headers);
}
@@ -377,7 +377,7 @@ class Response
if (\function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
- } elseif (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
+ } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
static::closeOutputBuffers(0, true);
}
@@ -397,7 +397,7 @@ class Response
*/
public function setContent($content)
{
- if (null !== $content && !\is_string($content) && !is_numeric($content) && !\is_callable(array($content, '__toString'))) {
+ if (null !== $content && !\is_string($content) && !is_numeric($content) && !\is_callable([$content, '__toString'])) {
throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', \gettype($content)));
}
@@ -529,7 +529,7 @@ class Response
*/
public function isCacheable(): bool
{
- if (!\in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) {
+ if (!\in_array($this->statusCode, [200, 203, 300, 301, 302, 404, 410])) {
return false;
}
@@ -939,7 +939,7 @@ class Response
*/
public function setCache(array $options)
{
- if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'))) {
+ if ($diff = array_diff(array_keys($options), ['etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'])) {
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff)));
}
@@ -1000,7 +1000,7 @@ class Response
$this->setContent(null);
// remove headers that MUST NOT be included with 304 Not Modified responses
- foreach (array('Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified') as $header) {
+ foreach (['Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified'] as $header) {
$this->headers->remove($header);
}
@@ -1025,10 +1025,10 @@ class Response
public function getVary(): array
{
if (!$vary = $this->headers->get('Vary', null, false)) {
- return array();
+ return [];
}
- $ret = array();
+ $ret = [];
foreach ($vary as $item) {
$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
}
@@ -1188,7 +1188,7 @@ class Response
*/
public function isRedirect(string $location = null): bool
{
- return \in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location'));
+ return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location'));
}
/**
@@ -1198,7 +1198,7 @@ class Response
*/
public function isEmpty(): bool
{
- return \in_array($this->statusCode, array(204, 304));
+ return \in_array($this->statusCode, [204, 304]);
}
/**
diff --git a/vendor/symfony/http-foundation/ResponseHeaderBag.php b/vendor/symfony/http-foundation/ResponseHeaderBag.php
index 1141e8d987..9dd8908b27 100644
--- a/vendor/symfony/http-foundation/ResponseHeaderBag.php
+++ b/vendor/symfony/http-foundation/ResponseHeaderBag.php
@@ -24,11 +24,11 @@ class ResponseHeaderBag extends HeaderBag
const DISPOSITION_ATTACHMENT = 'attachment';
const DISPOSITION_INLINE = 'inline';
- protected $computedCacheControl = array();
- protected $cookies = array();
- protected $headerNames = array();
+ protected $computedCacheControl = [];
+ protected $cookies = [];
+ protected $headerNames = [];
- public function __construct(array $headers = array())
+ public function __construct(array $headers = [])
{
parent::__construct($headers);
@@ -49,7 +49,7 @@ class ResponseHeaderBag extends HeaderBag
*/
public function allPreserveCase()
{
- $headers = array();
+ $headers = [];
foreach ($this->all() as $name => $value) {
$headers[isset($this->headerNames[$name]) ? $this->headerNames[$name] : $name] = $value;
}
@@ -70,9 +70,9 @@ class ResponseHeaderBag extends HeaderBag
/**
* {@inheritdoc}
*/
- public function replace(array $headers = array())
+ public function replace(array $headers = [])
{
- $this->headerNames = array();
+ $this->headerNames = [];
parent::replace($headers);
@@ -107,7 +107,7 @@ class ResponseHeaderBag extends HeaderBag
if ('set-cookie' === $uniqueKey) {
if ($replace) {
- $this->cookies = array();
+ $this->cookies = [];
}
foreach ((array) $values as $cookie) {
$this->setCookie(Cookie::fromString($cookie));
@@ -122,9 +122,9 @@ class ResponseHeaderBag extends HeaderBag
parent::set($key, $values, $replace);
// ensure the cache-control header has sensible defaults
- if (\in_array($uniqueKey, array('cache-control', 'etag', 'last-modified', 'expires'), true)) {
+ if (\in_array($uniqueKey, ['cache-control', 'etag', 'last-modified', 'expires'], true)) {
$computed = $this->computeCacheControlValue();
- $this->headers['cache-control'] = array($computed);
+ $this->headers['cache-control'] = [$computed];
$this->headerNames['cache-control'] = 'Cache-Control';
$this->computedCacheControl = $this->parseCacheControl($computed);
}
@@ -139,7 +139,7 @@ class ResponseHeaderBag extends HeaderBag
unset($this->headerNames[$uniqueKey]);
if ('set-cookie' === $uniqueKey) {
- $this->cookies = array();
+ $this->cookies = [];
return;
}
@@ -147,7 +147,7 @@ class ResponseHeaderBag extends HeaderBag
parent::remove($key);
if ('cache-control' === $uniqueKey) {
- $this->computedCacheControl = array();
+ $this->computedCacheControl = [];
}
if ('date' === $uniqueKey) {
@@ -216,15 +216,15 @@ class ResponseHeaderBag extends HeaderBag
*/
public function getCookies($format = self::COOKIES_FLAT)
{
- if (!\in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) {
- throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY))));
+ if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) {
+ throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY])));
}
if (self::COOKIES_ARRAY === $format) {
return $this->cookies;
}
- $flattenedCookies = array();
+ $flattenedCookies = [];
foreach ($this->cookies as $path) {
foreach ($path as $cookies) {
foreach ($cookies as $cookie) {
diff --git a/vendor/symfony/http-foundation/ServerBag.php b/vendor/symfony/http-foundation/ServerBag.php
index d8ab561aaf..90da49fae5 100644
--- a/vendor/symfony/http-foundation/ServerBag.php
+++ b/vendor/symfony/http-foundation/ServerBag.php
@@ -27,8 +27,8 @@ class ServerBag extends ParameterBag
*/
public function getHeaders()
{
- $headers = array();
- $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true);
+ $headers = [];
+ $contentHeaders = ['CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true];
foreach ($this->parameters as $key => $value) {
if (0 === strpos($key, 'HTTP_')) {
$headers[substr($key, 5)] = $value;
diff --git a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
index 82577b804e..7b53e7fc76 100644
--- a/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
+++ b/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php
@@ -19,7 +19,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
private $name = 'attributes';
private $storageKey;
- protected $attributes = array();
+ protected $attributes = [];
/**
* @param string $storageKey The key used to store attributes in the session
@@ -95,7 +95,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
*/
public function replace(array $attributes)
{
- $this->attributes = array();
+ $this->attributes = [];
foreach ($attributes as $key => $value) {
$this->set($key, $value);
}
@@ -121,7 +121,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
public function clear()
{
$return = $this->attributes;
- $this->attributes = array();
+ $this->attributes = [];
return $return;
}
diff --git a/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php b/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
index 50cd740d95..7890214e82 100644
--- a/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
+++ b/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
@@ -115,7 +115,7 @@ class NamespacedAttributeBag extends AttributeBag
return $array;
}
- $array[$parts[0]] = array();
+ $array[$parts[0]] = [];
return $array;
}
@@ -130,7 +130,7 @@ class NamespacedAttributeBag extends AttributeBag
return $null;
}
- $array[$part] = array();
+ $array[$part] = [];
}
$array = &$array[$part];
diff --git a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
index ef23457b41..782665caff 100644
--- a/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
+++ b/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php
@@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Flash;
class AutoExpireFlashBag implements FlashBagInterface
{
private $name = 'flashes';
- private $flashes = array('display' => array(), 'new' => array());
+ private $flashes = ['display' => [], 'new' => []];
private $storageKey;
/**
@@ -53,8 +53,8 @@ class AutoExpireFlashBag implements FlashBagInterface
// The logic: messages from the last request will be stored in new, so we move them to previous
// This request we will show what is in 'display'. What is placed into 'new' this time round will
// be moved to display next time round.
- $this->flashes['display'] = array_key_exists('new', $this->flashes) ? $this->flashes['new'] : array();
- $this->flashes['new'] = array();
+ $this->flashes['display'] = array_key_exists('new', $this->flashes) ? $this->flashes['new'] : [];
+ $this->flashes['new'] = [];
}
/**
@@ -68,7 +68,7 @@ class AutoExpireFlashBag implements FlashBagInterface
/**
* {@inheritdoc}
*/
- public function peek($type, array $default = array())
+ public function peek($type, array $default = [])
{
return $this->has($type) ? $this->flashes['display'][$type] : $default;
}
@@ -78,13 +78,13 @@ class AutoExpireFlashBag implements FlashBagInterface
*/
public function peekAll()
{
- return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : array();
+ return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : [];
}
/**
* {@inheritdoc}
*/
- public function get($type, array $default = array())
+ public function get($type, array $default = [])
{
$return = $default;
@@ -106,7 +106,7 @@ class AutoExpireFlashBag implements FlashBagInterface
public function all()
{
$return = $this->flashes['display'];
- $this->flashes['display'] = array();
+ $this->flashes['display'] = [];
return $return;
}
diff --git a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
index 44ddb96330..9674e3514b 100644
--- a/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
+++ b/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
@@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Flash;
class FlashBag implements FlashBagInterface
{
private $name = 'flashes';
- private $flashes = array();
+ private $flashes = [];
private $storageKey;
/**
@@ -62,7 +62,7 @@ class FlashBag implements FlashBagInterface
/**
* {@inheritdoc}
*/
- public function peek($type, array $default = array())
+ public function peek($type, array $default = [])
{
return $this->has($type) ? $this->flashes[$type] : $default;
}
@@ -78,7 +78,7 @@ class FlashBag implements FlashBagInterface
/**
* {@inheritdoc}
*/
- public function get($type, array $default = array())
+ public function get($type, array $default = [])
{
if (!$this->has($type)) {
return $default;
@@ -97,7 +97,7 @@ class FlashBag implements FlashBagInterface
public function all()
{
$return = $this->peekAll();
- $this->flashes = array();
+ $this->flashes = [];
return $return;
}
diff --git a/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php b/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php
index f53c9dae6c..2bd1d62bdb 100644
--- a/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php
+++ b/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php
@@ -44,7 +44,7 @@ interface FlashBagInterface extends SessionBagInterface
*
* @return array
*/
- public function peek($type, array $default = array());
+ public function peek($type, array $default = []);
/**
* Gets all flash messages.
@@ -61,7 +61,7 @@ interface FlashBagInterface extends SessionBagInterface
*
* @return array
*/
- public function get($type, array $default = array());
+ public function get($type, array $default = []);
/**
* Gets and clears flashes from the stack.
diff --git a/vendor/symfony/http-foundation/Session/Session.php b/vendor/symfony/http-foundation/Session/Session.php
index 3349906875..867ceba97f 100644
--- a/vendor/symfony/http-foundation/Session/Session.php
+++ b/vendor/symfony/http-foundation/Session/Session.php
@@ -28,7 +28,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
private $flashName;
private $attributeName;
- private $data = array();
+ private $data = [];
private $usageIndex = 0;
/**
diff --git a/vendor/symfony/http-foundation/Session/SessionUtils.php b/vendor/symfony/http-foundation/Session/SessionUtils.php
index 91737c39ac..b5bce4a884 100644
--- a/vendor/symfony/http-foundation/Session/SessionUtils.php
+++ b/vendor/symfony/http-foundation/Session/SessionUtils.php
@@ -30,7 +30,7 @@ final class SessionUtils
$sessionCookie = null;
$sessionCookiePrefix = sprintf(' %s=', urlencode($sessionName));
$sessionCookieWithId = sprintf('%s%s;', $sessionCookiePrefix, urlencode($sessionId));
- $otherCookies = array();
+ $otherCookies = [];
foreach (headers_list() as $h) {
if (0 !== stripos($h, 'Set-Cookie:')) {
continue;
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
index 95f110332a..defca606ef 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
@@ -104,7 +104,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
{
if (null === $this->igbinaryEmptyData) {
// see https://github.com/igbinary/igbinary/issues/146
- $this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize(array()) : '';
+ $this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize([]) : '';
}
if ('' === $data || $this->igbinaryEmptyData === $data) {
return $this->destroy($sessionId);
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
index 61a7afd904..1db590b360 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
@@ -45,11 +45,11 @@ class MemcachedSessionHandler extends AbstractSessionHandler
*
* @throws \InvalidArgumentException When unsupported options are passed
*/
- public function __construct(\Memcached $memcached, array $options = array())
+ public function __construct(\Memcached $memcached, array $options = [])
{
$this->memcached = $memcached;
- if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) {
+ if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime'])) {
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
}
@@ -62,7 +62,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
*/
public function close()
{
- return true;
+ return $this->memcached->quit();
}
/**
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
index 853b0bc723..904dc1b523 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
@@ -74,12 +74,12 @@ class MongoDbSessionHandler extends AbstractSessionHandler
$this->mongo = $mongo;
- $this->options = array_merge(array(
+ $this->options = array_merge([
'id_field' => '_id',
'data_field' => 'data',
'time_field' => 'time',
'expiry_field' => 'expires_at',
- ), $options);
+ ], $options);
}
/**
@@ -95,9 +95,9 @@ class MongoDbSessionHandler extends AbstractSessionHandler
*/
protected function doDestroy($sessionId)
{
- $this->getCollection()->deleteOne(array(
+ $this->getCollection()->deleteOne([
$this->options['id_field'] => $sessionId,
- ));
+ ]);
return true;
}
@@ -107,9 +107,9 @@ class MongoDbSessionHandler extends AbstractSessionHandler
*/
public function gc($maxlifetime)
{
- $this->getCollection()->deleteMany(array(
- $this->options['expiry_field'] => array('$lt' => new \MongoDB\BSON\UTCDateTime()),
- ));
+ $this->getCollection()->deleteMany([
+ $this->options['expiry_field'] => ['$lt' => new \MongoDB\BSON\UTCDateTime()],
+ ]);
return true;
}
@@ -121,16 +121,16 @@ class MongoDbSessionHandler extends AbstractSessionHandler
{
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
- $fields = array(
+ $fields = [
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
$this->options['expiry_field'] => $expiry,
$this->options['data_field'] => new \MongoDB\BSON\Binary($data, \MongoDB\BSON\Binary::TYPE_OLD_BINARY),
- );
+ ];
$this->getCollection()->updateOne(
- array($this->options['id_field'] => $sessionId),
- array('$set' => $fields),
- array('upsert' => true)
+ [$this->options['id_field'] => $sessionId],
+ ['$set' => $fields],
+ ['upsert' => true]
);
return true;
@@ -144,11 +144,11 @@ class MongoDbSessionHandler extends AbstractSessionHandler
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
$this->getCollection()->updateOne(
- array($this->options['id_field'] => $sessionId),
- array('$set' => array(
+ [$this->options['id_field'] => $sessionId],
+ ['$set' => [
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
$this->options['expiry_field'] => $expiry,
- ))
+ ]]
);
return true;
@@ -159,10 +159,10 @@ class MongoDbSessionHandler extends AbstractSessionHandler
*/
protected function doRead($sessionId)
{
- $dbData = $this->getCollection()->findOne(array(
+ $dbData = $this->getCollection()->findOne([
$this->options['id_field'] => $sessionId,
- $this->options['expiry_field'] => array('$gte' => new \MongoDB\BSON\UTCDateTime()),
- ));
+ $this->options['expiry_field'] => ['$gte' => new \MongoDB\BSON\UTCDateTime()],
+ ]);
if (null === $dbData) {
return '';
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
index 1bb647ef42..0623318d0a 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -118,7 +118,7 @@ class PdoSessionHandler extends AbstractSessionHandler
/**
* @var array Connection options when lazy-connect
*/
- private $connectionOptions = array();
+ private $connectionOptions = [];
/**
* @var int The strategy for locking, see constants
@@ -130,7 +130,7 @@ class PdoSessionHandler extends AbstractSessionHandler
*
* @var \PDOStatement[] An array of statements to release advisory locks
*/
- private $unlockStatements = array();
+ private $unlockStatements = [];
/**
* @var bool True when the current session exists but expired according to session.gc_maxlifetime
@@ -161,7 +161,7 @@ class PdoSessionHandler extends AbstractSessionHandler
* * db_time_col: The column where to store the timestamp [default: sess_time]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
- * * db_connection_options: An array of driver-specific connection options [default: array()]
+ * * db_connection_options: An array of driver-specific connection options [default: []]
* * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
*
* @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null
@@ -169,7 +169,7 @@ class PdoSessionHandler extends AbstractSessionHandler
*
* @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
*/
- public function __construct($pdoOrDsn = null, array $options = array())
+ public function __construct($pdoOrDsn = null, array $options = [])
{
if ($pdoOrDsn instanceof \PDO) {
if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
@@ -468,13 +468,13 @@ class PdoSessionHandler extends AbstractSessionHandler
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler');
}
- $driverAliasMap = array(
+ $driverAliasMap = [
'mssql' => 'sqlsrv',
'mysql2' => 'mysql', // Amazon RDS, for some weird reason
'postgres' => 'pgsql',
'postgresql' => 'pgsql',
'sqlite3' => 'sqlite',
- );
+ ];
$driver = isset($driverAliasMap[$params['scheme']]) ? $driverAliasMap[$params['scheme']] : $params['scheme'];
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
index 9c08ddcc01..a6498b882c 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
@@ -39,7 +39,7 @@ class RedisSessionHandler extends AbstractSessionHandler
*
* @throws \InvalidArgumentException When unsupported client or options are passed
*/
- public function __construct($redis, array $options = array())
+ public function __construct($redis, array $options = [])
{
if (
!$redis instanceof \Redis &&
@@ -52,7 +52,7 @@ class RedisSessionHandler extends AbstractSessionHandler
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
}
- if ($diff = array_diff(array_keys($options), array('prefix'))) {
+ if ($diff = array_diff(array_keys($options), ['prefix'])) {
throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
}
diff --git a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
index ea0d5ecb51..2eff4109b4 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
@@ -39,7 +39,7 @@ class MetadataBag implements SessionBagInterface
/**
* @var array
*/
- protected $meta = array(self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0);
+ protected $meta = [self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0];
/**
* Unix timestamp.
diff --git a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
index 47cac39854..37b6f145b8 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
@@ -50,7 +50,7 @@ class MockArraySessionStorage implements SessionStorageInterface
/**
* @var array
*/
- protected $data = array();
+ protected $data = [];
/**
* @var MetadataBag
@@ -60,7 +60,7 @@ class MockArraySessionStorage implements SessionStorageInterface
/**
* @var array|SessionBagInterface[]
*/
- protected $bags = array();
+ protected $bags = [];
public function __construct(string $name = 'MOCKSESSID', MetadataBag $metaBag = null)
{
@@ -166,7 +166,7 @@ class MockArraySessionStorage implements SessionStorageInterface
}
// clear out the session
- $this->data = array();
+ $this->data = [];
// reconnect the bags to the session
$this->loadSession();
@@ -238,11 +238,11 @@ class MockArraySessionStorage implements SessionStorageInterface
protected function loadSession()
{
- $bags = array_merge($this->bags, array($this->metadataBag));
+ $bags = array_merge($this->bags, [$this->metadataBag]);
foreach ($bags as $bag) {
$key = $bag->getStorageKey();
- $this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : array();
+ $this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : [];
$bag->initialize($this->data[$key]);
}
diff --git a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
index 732f92abf9..c0316c2c74 100644
--- a/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
@@ -98,7 +98,7 @@ class MockFileSessionStorage extends MockArraySessionStorage
unset($data[$key]);
}
}
- if (array($key = $this->metadataBag->getStorageKey()) === array_keys($data)) {
+ if ([$key = $this->metadataBag->getStorageKey()] === array_keys($data)) {
unset($data[$key]);
}
@@ -145,7 +145,7 @@ class MockFileSessionStorage extends MockArraySessionStorage
private function read()
{
$filePath = $this->getFilePath();
- $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : array();
+ $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : [];
$this->loadSession();
}
diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
index 232eb64cfd..ce7027954e 100644
--- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
@@ -27,7 +27,7 @@ class NativeSessionStorage implements SessionStorageInterface
/**
* @var SessionBagInterface[]
*/
- protected $bags = array();
+ protected $bags = [];
/**
* @var bool
@@ -101,15 +101,15 @@ class NativeSessionStorage implements SessionStorageInterface
* @param \SessionHandlerInterface|null $handler
* @param MetadataBag $metaBag MetadataBag
*/
- public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null)
+ public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null)
{
- $options += array(
+ $options += [
'cache_limiter' => '',
'cache_expire' => 0,
'use_cookies' => 1,
'lazy_write' => 1,
'use_strict_mode' => 1,
- );
+ ];
session_register_shutdown();
@@ -244,7 +244,7 @@ class NativeSessionStorage implements SessionStorageInterface
unset($_SESSION[$key]);
}
}
- if (array($key = $this->metadataBag->getStorageKey()) === array_keys($_SESSION)) {
+ if ([$key = $this->metadataBag->getStorageKey()] === array_keys($_SESSION)) {
unset($_SESSION[$key]);
}
@@ -280,7 +280,7 @@ class NativeSessionStorage implements SessionStorageInterface
}
// clear out the session
- $_SESSION = array();
+ $_SESSION = [];
// reconnect the bags to the session
$this->loadSession();
@@ -349,7 +349,7 @@ class NativeSessionStorage implements SessionStorageInterface
* For convenience we omit 'session.' from the beginning of the keys.
* Explicitly ignores other ini keys.
*
- * @param array $options Session ini directives array(key => value)
+ * @param array $options Session ini directives [key => value]
*
* @see http://php.net/session.configuration
*/
@@ -359,7 +359,7 @@ class NativeSessionStorage implements SessionStorageInterface
return;
}
- $validOptions = array_flip(array(
+ $validOptions = array_flip([
'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
'cookie_lifetime', 'cookie_path', 'cookie_secure', 'cookie_samesite',
'gc_divisor', 'gc_maxlifetime', 'gc_probability',
@@ -369,7 +369,7 @@ class NativeSessionStorage implements SessionStorageInterface
'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name',
'upload_progress.freq', 'upload_progress.min_freq', 'url_rewriter.tags',
'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags',
- ));
+ ]);
foreach ($options as $key => $value) {
if (isset($validOptions[$key])) {
@@ -445,11 +445,11 @@ class NativeSessionStorage implements SessionStorageInterface
$session = &$_SESSION;
}
- $bags = array_merge($this->bags, array($this->metadataBag));
+ $bags = array_merge($this->bags, [$this->metadataBag]);
foreach ($bags as $bag) {
$key = $bag->getStorageKey();
- $session[$key] = isset($session[$key]) ? $session[$key] : array();
+ $session[$key] = isset($session[$key]) ? $session[$key] : [];
$bag->initialize($session[$key]);
}
diff --git a/vendor/symfony/http-foundation/StreamedResponse.php b/vendor/symfony/http-foundation/StreamedResponse.php
index d3bcbb79d3..8310ea72d6 100644
--- a/vendor/symfony/http-foundation/StreamedResponse.php
+++ b/vendor/symfony/http-foundation/StreamedResponse.php
@@ -35,7 +35,7 @@ class StreamedResponse extends Response
* @param int $status The response status code
* @param array $headers An array of response headers
*/
- public function __construct(callable $callback = null, int $status = 200, array $headers = array())
+ public function __construct(callable $callback = null, int $status = 200, array $headers = [])
{
parent::__construct(null, $status, $headers);
@@ -55,7 +55,7 @@ class StreamedResponse extends Response
*
* @return static
*/
- public static function create($callback = null, $status = 200, $headers = array())
+ public static function create($callback = null, $status = 200, $headers = [])
{
return new static($callback, $status, $headers);
}
diff --git a/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php b/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php
index 1a660247c8..516bd5551a 100644
--- a/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php
+++ b/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php
@@ -28,24 +28,24 @@ class AcceptHeaderItemTest extends TestCase
public function provideFromStringData()
{
- return array(
- array(
+ return [
+ [
'text/html',
- 'text/html', array(),
- ),
- array(
+ 'text/html', [],
+ ],
+ [
'"this;should,not=matter"',
- 'this;should,not=matter', array(),
- ),
- array(
+ 'this;should,not=matter', [],
+ ],
+ [
"text/plain; charset=utf-8;param=\"this;should,not=matter\";\tfootnotes=true",
- 'text/plain', array('charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'),
- ),
- array(
+ 'text/plain', ['charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'],
+ ],
+ [
'"this;should,not=matter";charset=utf-8',
- 'this;should,not=matter', array('charset' => 'utf-8'),
- ),
- );
+ 'this;should,not=matter', ['charset' => 'utf-8'],
+ ],
+ ];
}
/**
@@ -59,21 +59,21 @@ class AcceptHeaderItemTest extends TestCase
public function provideToStringData()
{
- return array(
- array(
- 'text/html', array(),
+ return [
+ [
+ 'text/html', [],
'text/html',
- ),
- array(
- 'text/plain', array('charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'),
+ ],
+ [
+ 'text/plain', ['charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'],
'text/plain; charset=utf-8; param="this;should,not=matter"; footnotes=true',
- ),
- );
+ ],
+ ];
}
public function testValue()
{
- $item = new AcceptHeaderItem('value', array());
+ $item = new AcceptHeaderItem('value', []);
$this->assertEquals('value', $item->getValue());
$item->setValue('new value');
@@ -85,7 +85,7 @@ class AcceptHeaderItemTest extends TestCase
public function testQuality()
{
- $item = new AcceptHeaderItem('value', array());
+ $item = new AcceptHeaderItem('value', []);
$this->assertEquals(1.0, $item->getQuality());
$item->setQuality(0.5);
@@ -98,14 +98,14 @@ class AcceptHeaderItemTest extends TestCase
public function testAttribute()
{
- $item = new AcceptHeaderItem('value', array());
- $this->assertEquals(array(), $item->getAttributes());
+ $item = new AcceptHeaderItem('value', []);
+ $this->assertEquals([], $item->getAttributes());
$this->assertFalse($item->hasAttribute('test'));
$this->assertNull($item->getAttribute('test'));
$this->assertEquals('default', $item->getAttribute('test', 'default'));
$item->setAttribute('test', 'value');
- $this->assertEquals(array('test' => 'value'), $item->getAttributes());
+ $this->assertEquals(['test' => 'value'], $item->getAttributes());
$this->assertTrue($item->hasAttribute('test'));
$this->assertEquals('value', $item->getAttribute('test'));
$this->assertEquals('value', $item->getAttribute('test', 'default'));
diff --git a/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php b/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php
index 1ac6103e0d..1987e97fb8 100644
--- a/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php
+++ b/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php
@@ -39,13 +39,13 @@ class AcceptHeaderTest extends TestCase
public function provideFromStringData()
{
- return array(
- array('', array()),
- array('gzip', array(new AcceptHeaderItem('gzip'))),
- array('gzip,deflate,sdch', array(new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch'))),
- array("gzip, deflate\t,sdch", array(new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch'))),
- array('"this;should,not=matter"', array(new AcceptHeaderItem('this;should,not=matter'))),
- );
+ return [
+ ['', []],
+ ['gzip', [new AcceptHeaderItem('gzip')]],
+ ['gzip,deflate,sdch', [new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch')]],
+ ["gzip, deflate\t,sdch", [new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch')]],
+ ['"this;should,not=matter"', [new AcceptHeaderItem('this;should,not=matter')]],
+ ];
}
/**
@@ -59,12 +59,12 @@ class AcceptHeaderTest extends TestCase
public function provideToStringData()
{
- return array(
- array(array(), ''),
- array(array(new AcceptHeaderItem('gzip')), 'gzip'),
- array(array(new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch')), 'gzip,deflate,sdch'),
- array(array(new AcceptHeaderItem('this;should,not=matter')), 'this;should,not=matter'),
- );
+ return [
+ [[], ''],
+ [[new AcceptHeaderItem('gzip')], 'gzip'],
+ [[new AcceptHeaderItem('gzip'), new AcceptHeaderItem('deflate'), new AcceptHeaderItem('sdch')], 'gzip,deflate,sdch'],
+ [[new AcceptHeaderItem('this;should,not=matter')], 'this;should,not=matter'],
+ ];
}
/**
@@ -78,9 +78,9 @@ class AcceptHeaderTest extends TestCase
public function provideFilterData()
{
- return array(
- array('fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4', '/fr.*/', array('fr-FR', 'fr')),
- );
+ return [
+ ['fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4', '/fr.*/', ['fr-FR', 'fr']],
+ ];
}
/**
@@ -94,11 +94,11 @@ class AcceptHeaderTest extends TestCase
public function provideSortingData()
{
- return array(
- 'quality has priority' => array('*;q=0.3,ISO-8859-1,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')),
- 'order matters when q is equal' => array('*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')),
- 'order matters when q is equal2' => array('*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', array('utf-8', 'ISO-8859-1', '*')),
- );
+ return [
+ 'quality has priority' => ['*;q=0.3,ISO-8859-1,utf-8;q=0.7', ['ISO-8859-1', 'utf-8', '*']],
+ 'order matters when q is equal' => ['*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', ['ISO-8859-1', 'utf-8', '*']],
+ 'order matters when q is equal2' => ['*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', ['utf-8', 'ISO-8859-1', '*']],
+ ];
}
/**
@@ -112,19 +112,19 @@ class AcceptHeaderTest extends TestCase
public function provideDefaultValueData()
{
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, *;q=0.3', 'text/xml', 0.3);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/xml', 0.3);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/html', 1.0);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/plain', 0.5);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', '*', 0.3);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', '*', 1.0);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', 'text/xml', 1.0);
- yield array('text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', 'text/*', 1.0);
- yield array('text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/*', 0.8);
- yield array('text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/html', 1.0);
- yield array('text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/x-dvi', 0.8);
- yield array('*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', '*', 0.3);
- yield array('*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', 'utf-8', 0.7);
- yield array('*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', 'SHIFT_JIS', 0.3);
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, *;q=0.3', 'text/xml', 0.3];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/xml', 0.3];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/html', 1.0];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', 'text/plain', 0.5];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*;q=0.3', '*', 0.3];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', '*', 1.0];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', 'text/xml', 1.0];
+ yield ['text/plain;q=0.5, text/html, text/x-dvi;q=0.8, */*', 'text/*', 1.0];
+ yield ['text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/*', 0.8];
+ yield ['text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/html', 1.0];
+ yield ['text/plain;q=0.5, text/html, text/*;q=0.8, */*', 'text/x-dvi', 0.8];
+ yield ['*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', '*', 0.3];
+ yield ['*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', 'utf-8', 0.7];
+ yield ['*;q=0.3, ISO-8859-1;q=0.7, utf-8;q=0.7', 'SHIFT_JIS', 0.3];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php b/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php
index 157ab90ec5..6fa3b88917 100644
--- a/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php
+++ b/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php
@@ -31,63 +31,63 @@ class ApacheRequestTest extends TestCase
public function provideServerVars()
{
- return array(
- array(
- array(
+ return [
+ [
+ [
'REQUEST_URI' => '/foo/app_dev.php/bar',
'SCRIPT_NAME' => '/foo/app_dev.php',
'PATH_INFO' => '/bar',
- ),
+ ],
'/foo/app_dev.php/bar',
'/foo/app_dev.php',
'/bar',
- ),
- array(
- array(
+ ],
+ [
+ [
'REQUEST_URI' => '/foo/bar',
'SCRIPT_NAME' => '/foo/app_dev.php',
- ),
+ ],
'/foo/bar',
'/foo',
'/bar',
- ),
- array(
- array(
+ ],
+ [
+ [
'REQUEST_URI' => '/app_dev.php/foo/bar',
'SCRIPT_NAME' => '/app_dev.php',
'PATH_INFO' => '/foo/bar',
- ),
+ ],
'/app_dev.php/foo/bar',
'/app_dev.php',
'/foo/bar',
- ),
- array(
- array(
+ ],
+ [
+ [
'REQUEST_URI' => '/foo/bar',
'SCRIPT_NAME' => '/app_dev.php',
- ),
+ ],
'/foo/bar',
'',
'/foo/bar',
- ),
- array(
- array(
+ ],
+ [
+ [
'REQUEST_URI' => '/app_dev.php',
'SCRIPT_NAME' => '/app_dev.php',
- ),
+ ],
'/app_dev.php',
'/app_dev.php',
'/',
- ),
- array(
- array(
+ ],
+ [
+ [
'REQUEST_URI' => '/',
'SCRIPT_NAME' => '/app_dev.php',
- ),
+ ],
'/',
'',
'/',
- ),
- );
+ ],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php b/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php
index 6bf04e16b7..9f3beb08d1 100644
--- a/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php
@@ -22,14 +22,14 @@ class BinaryFileResponseTest extends ResponseTestCase
public function testConstruction()
{
$file = __DIR__.'/../README.md';
- $response = new BinaryFileResponse($file, 404, array('X-Header' => 'Foo'), true, null, true, true);
+ $response = new BinaryFileResponse($file, 404, ['X-Header' => 'Foo'], true, null, true, true);
$this->assertEquals(404, $response->getStatusCode());
$this->assertEquals('Foo', $response->headers->get('X-Header'));
$this->assertTrue($response->headers->has('ETag'));
$this->assertTrue($response->headers->has('Last-Modified'));
$this->assertFalse($response->headers->has('Content-Disposition'));
- $response = BinaryFileResponse::create($file, 404, array(), true, ResponseHeaderBag::DISPOSITION_INLINE);
+ $response = BinaryFileResponse::create($file, 404, [], true, ResponseHeaderBag::DISPOSITION_INLINE);
$this->assertEquals(404, $response->getStatusCode());
$this->assertFalse($response->headers->has('ETag'));
$this->assertEquals('inline; filename=README.md', $response->headers->get('Content-Disposition'));
@@ -39,7 +39,7 @@ class BinaryFileResponseTest extends ResponseTestCase
{
touch(sys_get_temp_dir().'/fööö.html');
- $response = new BinaryFileResponse(sys_get_temp_dir().'/fööö.html', 200, array(), true, 'attachment');
+ $response = new BinaryFileResponse(sys_get_temp_dir().'/fööö.html', 200, [], true, 'attachment');
@unlink(sys_get_temp_dir().'/fööö.html');
@@ -85,7 +85,7 @@ class BinaryFileResponseTest extends ResponseTestCase
*/
public function testRequests($requestRange, $offset, $length, $responseRange)
{
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag();
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream'])->setAutoEtag();
// do a request to get the ETag
$request = Request::create('/');
@@ -117,7 +117,7 @@ class BinaryFileResponseTest extends ResponseTestCase
*/
public function testRequestsWithoutEtag($requestRange, $offset, $length, $responseRange)
{
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'));
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream']);
// do a request to get the LastModified
$request = Request::create('/');
@@ -145,19 +145,19 @@ class BinaryFileResponseTest extends ResponseTestCase
public function provideRanges()
{
- return array(
- array('bytes=1-4', 1, 4, 'bytes 1-4/35'),
- array('bytes=-5', 30, 5, 'bytes 30-34/35'),
- array('bytes=30-', 30, 5, 'bytes 30-34/35'),
- array('bytes=30-30', 30, 1, 'bytes 30-30/35'),
- array('bytes=30-34', 30, 5, 'bytes 30-34/35'),
- );
+ return [
+ ['bytes=1-4', 1, 4, 'bytes 1-4/35'],
+ ['bytes=-5', 30, 5, 'bytes 30-34/35'],
+ ['bytes=30-', 30, 5, 'bytes 30-34/35'],
+ ['bytes=30-30', 30, 1, 'bytes 30-30/35'],
+ ['bytes=30-34', 30, 5, 'bytes 30-34/35'],
+ ];
}
public function testRangeRequestsWithoutLastModifiedDate()
{
// prevent auto last modified
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'), true, null, false, false);
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream'], true, null, false, false);
// prepare a request for a range of the testing file
$request = Request::create('/');
@@ -178,7 +178,7 @@ class BinaryFileResponseTest extends ResponseTestCase
*/
public function testFullFileRequests($requestRange)
{
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag();
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream'])->setAutoEtag();
// prepare a request for a range of the testing file
$request = Request::create('/');
@@ -198,14 +198,14 @@ class BinaryFileResponseTest extends ResponseTestCase
public function provideFullFileRanges()
{
- return array(
- array('bytes=0-'),
- array('bytes=0-34'),
- array('bytes=-35'),
+ return [
+ ['bytes=0-'],
+ ['bytes=0-34'],
+ ['bytes=-35'],
// Syntactical invalid range-request should also return the full resource
- array('bytes=20-10'),
- array('bytes=50-40'),
- );
+ ['bytes=20-10'],
+ ['bytes=50-40'],
+ ];
}
public function testUnpreparedResponseSendsFullFile()
@@ -226,7 +226,7 @@ class BinaryFileResponseTest extends ResponseTestCase
*/
public function testInvalidRequests($requestRange)
{
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag();
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream'])->setAutoEtag();
// prepare a request for a range of the testing file
$request = Request::create('/');
@@ -242,10 +242,10 @@ class BinaryFileResponseTest extends ResponseTestCase
public function provideInvalidRanges()
{
- return array(
- array('bytes=-40'),
- array('bytes=30-40'),
- );
+ return [
+ ['bytes=-40'],
+ ['bytes=30-40'],
+ ];
}
/**
@@ -257,7 +257,7 @@ class BinaryFileResponseTest extends ResponseTestCase
$request->headers->set('X-Sendfile-Type', 'X-Sendfile');
BinaryFileResponse::trustXSendfileTypeHeader();
- $response = BinaryFileResponse::create($file, 200, array('Content-Type' => 'application/octet-stream'));
+ $response = BinaryFileResponse::create($file, 200, ['Content-Type' => 'application/octet-stream']);
$response->prepare($request);
$this->expectOutputString('');
@@ -268,10 +268,10 @@ class BinaryFileResponseTest extends ResponseTestCase
public function provideXSendfileFiles()
{
- return array(
- array(__DIR__.'/../README.md'),
- array('file://'.__DIR__.'/../README.md'),
- );
+ return [
+ [__DIR__.'/../README.md'],
+ ['file://'.__DIR__.'/../README.md'],
+ ];
}
/**
@@ -286,7 +286,7 @@ class BinaryFileResponseTest extends ResponseTestCase
$file = new FakeFile($realpath, __DIR__.'/File/Fixtures/test');
BinaryFileResponse::trustXSendfileTypeHeader();
- $response = new BinaryFileResponse($file, 200, array('Content-Type' => 'application/octet-stream'));
+ $response = new BinaryFileResponse($file, 200, ['Content-Type' => 'application/octet-stream']);
$reflection = new \ReflectionObject($response);
$property = $reflection->getProperty('file');
$property->setAccessible(true);
@@ -305,7 +305,7 @@ class BinaryFileResponseTest extends ResponseTestCase
$realPath = realpath($path);
$this->assertFileExists($realPath);
- $response = new BinaryFileResponse($realPath, 200, array('Content-Type' => 'application/octet-stream'));
+ $response = new BinaryFileResponse($realPath, 200, ['Content-Type' => 'application/octet-stream']);
$response->deleteFileAfterSend(true);
$response->prepare($request);
@@ -317,7 +317,7 @@ class BinaryFileResponseTest extends ResponseTestCase
public function testAcceptRangeOnUnsafeMethods()
{
$request = Request::create('/', 'POST');
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'));
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream']);
$response->prepare($request);
$this->assertEquals('none', $response->headers->get('Accept-Ranges'));
@@ -326,7 +326,7 @@ class BinaryFileResponseTest extends ResponseTestCase
public function testAcceptRangeNotOverriden()
{
$request = Request::create('/', 'POST');
- $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'));
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream']);
$response->headers->set('Accept-Ranges', 'foo');
$response->prepare($request);
@@ -335,17 +335,17 @@ class BinaryFileResponseTest extends ResponseTestCase
public function getSampleXAccelMappings()
{
- return array(
- array('/var/www/var/www/files/foo.txt', '/var/www/=/files/', '/files/var/www/files/foo.txt'),
- array('/home/Foo/bar.txt', '/var/www/=/files/,/home/Foo/=/baz/', '/baz/bar.txt'),
- array('/home/Foo/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', '/baz/bar.txt'),
- );
+ return [
+ ['/var/www/var/www/files/foo.txt', '/var/www/=/files/', '/files/var/www/files/foo.txt'],
+ ['/home/Foo/bar.txt', '/var/www/=/files/,/home/Foo/=/baz/', '/baz/bar.txt'],
+ ['/home/Foo/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', '/baz/bar.txt'],
+ ];
}
public function testStream()
{
$request = Request::create('/');
- $response = new BinaryFileResponse(new Stream(__DIR__.'/../README.md'), 200, array('Content-Type' => 'text/plain'));
+ $response = new BinaryFileResponse(new Stream(__DIR__.'/../README.md'), 200, ['Content-Type' => 'text/plain']);
$response->prepare($request);
$this->assertNull($response->headers->get('Content-Length'));
@@ -353,7 +353,7 @@ class BinaryFileResponseTest extends ResponseTestCase
protected function provideResponse()
{
- return new BinaryFileResponse(__DIR__.'/../README.md', 200, array('Content-Type' => 'application/octet-stream'));
+ return new BinaryFileResponse(__DIR__.'/../README.md', 200, ['Content-Type' => 'application/octet-stream']);
}
public static function tearDownAfterClass()
diff --git a/vendor/symfony/http-foundation/Tests/CookieTest.php b/vendor/symfony/http-foundation/Tests/CookieTest.php
index 44981dff8b..4aa32eea45 100644
--- a/vendor/symfony/http-foundation/Tests/CookieTest.php
+++ b/vendor/symfony/http-foundation/Tests/CookieTest.php
@@ -26,17 +26,17 @@ class CookieTest extends TestCase
{
public function invalidNames()
{
- return array(
- array(''),
- array(',MyName'),
- array(';MyName'),
- array(' MyName'),
- array("\tMyName"),
- array("\rMyName"),
- array("\nMyName"),
- array("\013MyName"),
- array("\014MyName"),
- );
+ return [
+ [''],
+ [',MyName'],
+ [';MyName'],
+ [' MyName'],
+ ["\tMyName"],
+ ["\rMyName"],
+ ["\nMyName"],
+ ["\013MyName"],
+ ["\014MyName"],
+ ];
}
/**
diff --git a/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php b/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php
index 1152e46c0b..2afdade67d 100644
--- a/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php
+++ b/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php
@@ -55,15 +55,15 @@ class ExpressionRequestMatcherTest extends TestCase
public function provideExpressions()
{
- return array(
- array('request.getMethod() == method', true),
- array('request.getPathInfo() == path', true),
- array('request.getHost() == host', true),
- array('request.getClientIp() == ip', true),
- array('request.attributes.all() == attributes', true),
- array('request.getMethod() == method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', true),
- array('request.getMethod() != method', false),
- array('request.getMethod() != method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', false),
- );
+ return [
+ ['request.getMethod() == method', true],
+ ['request.getPathInfo() == path', true],
+ ['request.getHost() == host', true],
+ ['request.getClientIp() == ip', true],
+ ['request.attributes.all() == attributes', true],
+ ['request.getMethod() == method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', true],
+ ['request.getMethod() != method', false],
+ ['request.getMethod() != method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', false],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/File/FileTest.php b/vendor/symfony/http-foundation/Tests/File/FileTest.php
index dbd9c44bd8..fb82dae768 100644
--- a/vendor/symfony/http-foundation/Tests/File/FileTest.php
+++ b/vendor/symfony/http-foundation/Tests/File/FileTest.php
@@ -110,14 +110,14 @@ class FileTest extends TestCase
public function getFilenameFixtures()
{
- return array(
- array('original.gif', 'original.gif'),
- array('..\\..\\original.gif', 'original.gif'),
- array('../../original.gif', 'original.gif'),
- array('файлfile.gif', 'файлfile.gif'),
- array('..\\..\\файлfile.gif', 'файлfile.gif'),
- array('../../файлfile.gif', 'файлfile.gif'),
- );
+ return [
+ ['original.gif', 'original.gif'],
+ ['..\\..\\original.gif', 'original.gif'],
+ ['../../original.gif', 'original.gif'],
+ ['файлfile.gif', 'файлfile.gif'],
+ ['..\\..\\файлfile.gif', 'файлfile.gif'],
+ ['../../файлfile.gif', 'файлfile.gif'],
+ ];
}
/**
diff --git a/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php b/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php
index 6a0b550d79..3952a69c69 100644
--- a/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php
+++ b/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php
@@ -147,13 +147,13 @@ class UploadedFileTest extends TestCase
public function failedUploadedFile()
{
- foreach (array(UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_EXTENSION, -1) as $error) {
- yield array(new UploadedFile(
+ foreach ([UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_EXTENSION, -1] as $error) {
+ yield [new UploadedFile(
__DIR__.'/Fixtures/test.gif',
'original.gif',
'image/gif',
$error
- ));
+ )];
}
}
@@ -323,13 +323,13 @@ class UploadedFileTest extends TestCase
public function uploadedFileErrorProvider()
{
- return array(
- array(UPLOAD_ERR_INI_SIZE),
- array(UPLOAD_ERR_FORM_SIZE),
- array(UPLOAD_ERR_PARTIAL),
- array(UPLOAD_ERR_NO_TMP_DIR),
- array(UPLOAD_ERR_EXTENSION),
- );
+ return [
+ [UPLOAD_ERR_INI_SIZE],
+ [UPLOAD_ERR_FORM_SIZE],
+ [UPLOAD_ERR_PARTIAL],
+ [UPLOAD_ERR_NO_TMP_DIR],
+ [UPLOAD_ERR_EXTENSION],
+ ];
}
public function testIsInvalidIfNotHttpUpload()
diff --git a/vendor/symfony/http-foundation/Tests/FileBagTest.php b/vendor/symfony/http-foundation/Tests/FileBagTest.php
index 06136e2097..5eaf64f89f 100644
--- a/vendor/symfony/http-foundation/Tests/FileBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/FileBagTest.php
@@ -28,7 +28,7 @@ class FileBagTest extends TestCase
*/
public function testFileMustBeAnArrayOrUploadedFile()
{
- new FileBag(array('file' => 'foo'));
+ new FileBag(['file' => 'foo']);
}
public function testShouldConvertsUploadedFiles()
@@ -36,54 +36,54 @@ class FileBagTest extends TestCase
$tmpFile = $this->createTempFile();
$file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain');
- $bag = new FileBag(array('file' => array(
+ $bag = new FileBag(['file' => [
'name' => basename($tmpFile),
'type' => 'text/plain',
'tmp_name' => $tmpFile,
'error' => 0,
'size' => null,
- )));
+ ]]);
$this->assertEquals($file, $bag->get('file'));
}
public function testShouldSetEmptyUploadedFilesToNull()
{
- $bag = new FileBag(array('file' => array(
+ $bag = new FileBag(['file' => [
'name' => '',
'type' => '',
'tmp_name' => '',
'error' => UPLOAD_ERR_NO_FILE,
'size' => 0,
- )));
+ ]]);
$this->assertNull($bag->get('file'));
}
public function testShouldRemoveEmptyUploadedFilesForMultiUpload()
{
- $bag = new FileBag(array('files' => array(
- 'name' => array(''),
- 'type' => array(''),
- 'tmp_name' => array(''),
- 'error' => array(UPLOAD_ERR_NO_FILE),
- 'size' => array(0),
- )));
+ $bag = new FileBag(['files' => [
+ 'name' => [''],
+ 'type' => [''],
+ 'tmp_name' => [''],
+ 'error' => [UPLOAD_ERR_NO_FILE],
+ 'size' => [0],
+ ]]);
- $this->assertSame(array(), $bag->get('files'));
+ $this->assertSame([], $bag->get('files'));
}
public function testShouldNotRemoveEmptyUploadedFilesForAssociativeArray()
{
- $bag = new FileBag(array('files' => array(
- 'name' => array('file1' => ''),
- 'type' => array('file1' => ''),
- 'tmp_name' => array('file1' => ''),
- 'error' => array('file1' => UPLOAD_ERR_NO_FILE),
- 'size' => array('file1' => 0),
- )));
+ $bag = new FileBag(['files' => [
+ 'name' => ['file1' => ''],
+ 'type' => ['file1' => ''],
+ 'tmp_name' => ['file1' => ''],
+ 'error' => ['file1' => UPLOAD_ERR_NO_FILE],
+ 'size' => ['file1' => 0],
+ ]]);
- $this->assertSame(array('file1' => null), $bag->get('files'));
+ $this->assertSame(['file1' => null], $bag->get('files'));
}
public function testShouldConvertUploadedFilesWithPhpBug()
@@ -91,25 +91,25 @@ class FileBagTest extends TestCase
$tmpFile = $this->createTempFile();
$file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain');
- $bag = new FileBag(array(
- 'child' => array(
- 'name' => array(
+ $bag = new FileBag([
+ 'child' => [
+ 'name' => [
'file' => basename($tmpFile),
- ),
- 'type' => array(
+ ],
+ 'type' => [
'file' => 'text/plain',
- ),
- 'tmp_name' => array(
+ ],
+ 'tmp_name' => [
'file' => $tmpFile,
- ),
- 'error' => array(
+ ],
+ 'error' => [
'file' => 0,
- ),
- 'size' => array(
+ ],
+ 'size' => [
'file' => null,
- ),
- ),
- ));
+ ],
+ ],
+ ]);
$files = $bag->all();
$this->assertEquals($file, $files['child']['file']);
@@ -120,25 +120,25 @@ class FileBagTest extends TestCase
$tmpFile = $this->createTempFile();
$file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain');
- $bag = new FileBag(array(
- 'child' => array(
- 'name' => array(
- 'sub' => array('file' => basename($tmpFile)),
- ),
- 'type' => array(
- 'sub' => array('file' => 'text/plain'),
- ),
- 'tmp_name' => array(
- 'sub' => array('file' => $tmpFile),
- ),
- 'error' => array(
- 'sub' => array('file' => 0),
- ),
- 'size' => array(
- 'sub' => array('file' => null),
- ),
- ),
- ));
+ $bag = new FileBag([
+ 'child' => [
+ 'name' => [
+ 'sub' => ['file' => basename($tmpFile)],
+ ],
+ 'type' => [
+ 'sub' => ['file' => 'text/plain'],
+ ],
+ 'tmp_name' => [
+ 'sub' => ['file' => $tmpFile],
+ ],
+ 'error' => [
+ 'sub' => ['file' => 0],
+ ],
+ 'size' => [
+ 'sub' => ['file' => null],
+ ],
+ ],
+ ]);
$files = $bag->all();
$this->assertEquals($file, $files['child']['sub']['file']);
@@ -148,7 +148,7 @@ class FileBagTest extends TestCase
{
$tmpFile = $this->createTempFile();
$file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain');
- $bag = new FileBag(array('image' => array('file' => $file)));
+ $bag = new FileBag(['image' => ['file' => $file]]);
$files = $bag->all();
$this->assertEquals($file, $files['image']['file']);
diff --git a/vendor/symfony/http-foundation/Tests/HeaderBagTest.php b/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
index c5a437f999..6c4915f2e4 100644
--- a/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
@@ -18,7 +18,7 @@ class HeaderBagTest extends TestCase
{
public function testConstructor()
{
- $bag = new HeaderBag(array('foo' => 'bar'));
+ $bag = new HeaderBag(['foo' => 'bar']);
$this->assertTrue($bag->has('foo'));
}
@@ -30,20 +30,20 @@ class HeaderBagTest extends TestCase
public function testToStringNotNull()
{
- $bag = new HeaderBag(array('foo' => 'bar'));
+ $bag = new HeaderBag(['foo' => 'bar']);
$this->assertEquals("Foo: bar\r\n", $bag->__toString());
}
public function testKeys()
{
- $bag = new HeaderBag(array('foo' => 'bar'));
+ $bag = new HeaderBag(['foo' => 'bar']);
$keys = $bag->keys();
$this->assertEquals('foo', $keys[0]);
}
public function testGetDate()
{
- $bag = new HeaderBag(array('foo' => 'Tue, 4 Sep 2012 20:00:00 +0200'));
+ $bag = new HeaderBag(['foo' => 'Tue, 4 Sep 2012 20:00:00 +0200']);
$headerDate = $bag->getDate('foo');
$this->assertInstanceOf('DateTime', $headerDate);
}
@@ -53,7 +53,7 @@ class HeaderBagTest extends TestCase
*/
public function testGetDateException()
{
- $bag = new HeaderBag(array('foo' => 'Tue'));
+ $bag = new HeaderBag(['foo' => 'Tue']);
$headerDate = $bag->getDate('foo');
}
@@ -67,50 +67,50 @@ class HeaderBagTest extends TestCase
public function testAll()
{
- $bag = new HeaderBag(array('foo' => 'bar'));
- $this->assertEquals(array('foo' => array('bar')), $bag->all(), '->all() gets all the input');
+ $bag = new HeaderBag(['foo' => 'bar']);
+ $this->assertEquals(['foo' => ['bar']], $bag->all(), '->all() gets all the input');
- $bag = new HeaderBag(array('FOO' => 'BAR'));
- $this->assertEquals(array('foo' => array('BAR')), $bag->all(), '->all() gets all the input key are lower case');
+ $bag = new HeaderBag(['FOO' => 'BAR']);
+ $this->assertEquals(['foo' => ['BAR']], $bag->all(), '->all() gets all the input key are lower case');
}
public function testReplace()
{
- $bag = new HeaderBag(array('foo' => 'bar'));
+ $bag = new HeaderBag(['foo' => 'bar']);
- $bag->replace(array('NOPE' => 'BAR'));
- $this->assertEquals(array('nope' => array('BAR')), $bag->all(), '->replace() replaces the input with the argument');
+ $bag->replace(['NOPE' => 'BAR']);
+ $this->assertEquals(['nope' => ['BAR']], $bag->all(), '->replace() replaces the input with the argument');
$this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input');
}
public function testGet()
{
- $bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
+ $bag = new HeaderBag(['foo' => 'bar', 'fuzz' => 'bizz']);
$this->assertEquals('bar', $bag->get('foo'), '->get return current value');
$this->assertEquals('bar', $bag->get('FoO'), '->get key in case insensitive');
- $this->assertEquals(array('bar'), $bag->get('foo', 'nope', false), '->get return the value as array');
+ $this->assertEquals(['bar'], $bag->get('foo', 'nope', false), '->get return the value as array');
// defaults
$this->assertNull($bag->get('none'), '->get unknown values returns null');
$this->assertEquals('default', $bag->get('none', 'default'), '->get unknown values returns default');
- $this->assertEquals(array('default'), $bag->get('none', 'default', false), '->get unknown values returns default as array');
+ $this->assertEquals(['default'], $bag->get('none', 'default', false), '->get unknown values returns default as array');
$bag->set('foo', 'bor', false);
$this->assertEquals('bar', $bag->get('foo'), '->get return first value');
- $this->assertEquals(array('bar', 'bor'), $bag->get('foo', 'nope', false), '->get return all values as array');
+ $this->assertEquals(['bar', 'bor'], $bag->get('foo', 'nope', false), '->get return all values as array');
}
public function testSetAssociativeArray()
{
$bag = new HeaderBag();
- $bag->set('foo', array('bad-assoc-index' => 'value'));
+ $bag->set('foo', ['bad-assoc-index' => 'value']);
$this->assertSame('value', $bag->get('foo'));
- $this->assertEquals(array('value'), $bag->get('foo', 'nope', false), 'assoc indices of multi-valued headers are ignored');
+ $this->assertEquals(['value'], $bag->get('foo', 'nope', false), 'assoc indices of multi-valued headers are ignored');
}
public function testContains()
{
- $bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz'));
+ $bag = new HeaderBag(['foo' => 'bar', 'fuzz' => 'bizz']);
$this->assertTrue($bag->contains('foo', 'bar'), '->contains first value');
$this->assertTrue($bag->contains('fuzz', 'bizz'), '->contains second value');
$this->assertFalse($bag->contains('nope', 'nope'), '->contains unknown value');
@@ -143,7 +143,7 @@ class HeaderBagTest extends TestCase
public function testCacheControlDirectiveParsing()
{
- $bag = new HeaderBag(array('cache-control' => 'public, max-age=10'));
+ $bag = new HeaderBag(['cache-control' => 'public, max-age=10']);
$this->assertTrue($bag->hasCacheControlDirective('public'));
$this->assertTrue($bag->getCacheControlDirective('public'));
@@ -156,15 +156,15 @@ class HeaderBagTest extends TestCase
public function testCacheControlDirectiveParsingQuotedZero()
{
- $bag = new HeaderBag(array('cache-control' => 'max-age="0"'));
+ $bag = new HeaderBag(['cache-control' => 'max-age="0"']);
$this->assertTrue($bag->hasCacheControlDirective('max-age'));
$this->assertEquals(0, $bag->getCacheControlDirective('max-age'));
}
public function testCacheControlDirectiveOverrideWithReplace()
{
- $bag = new HeaderBag(array('cache-control' => 'private, max-age=100'));
- $bag->replace(array('cache-control' => 'public, max-age=10'));
+ $bag = new HeaderBag(['cache-control' => 'private, max-age=100']);
+ $bag->replace(['cache-control' => 'public, max-age=10']);
$this->assertTrue($bag->hasCacheControlDirective('public'));
$this->assertTrue($bag->getCacheControlDirective('public'));
@@ -174,7 +174,7 @@ class HeaderBagTest extends TestCase
public function testCacheControlClone()
{
- $headers = array('foo' => 'bar');
+ $headers = ['foo' => 'bar'];
$bag1 = new HeaderBag($headers);
$bag2 = new HeaderBag($bag1->all());
@@ -183,13 +183,13 @@ class HeaderBagTest extends TestCase
public function testGetIterator()
{
- $headers = array('foo' => 'bar', 'hello' => 'world', 'third' => 'charm');
+ $headers = ['foo' => 'bar', 'hello' => 'world', 'third' => 'charm'];
$headerBag = new HeaderBag($headers);
$i = 0;
foreach ($headerBag as $key => $val) {
++$i;
- $this->assertEquals(array($headers[$key]), $val);
+ $this->assertEquals([$headers[$key]], $val);
}
$this->assertEquals(\count($headers), $i);
@@ -197,7 +197,7 @@ class HeaderBagTest extends TestCase
public function testCount()
{
- $headers = array('foo' => 'bar', 'HELLO' => 'WORLD');
+ $headers = ['foo' => 'bar', 'HELLO' => 'WORLD'];
$headerBag = new HeaderBag($headers);
$this->assertCount(\count($headers), $headerBag);
diff --git a/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php b/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
index 15efdf9234..2f82dc4e67 100644
--- a/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
+++ b/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
@@ -18,48 +18,48 @@ class HeaderUtilsTest extends TestCase
{
public function testSplit()
{
- $this->assertSame(array('foo=123', 'bar'), HeaderUtils::split('foo=123,bar', ','));
- $this->assertSame(array('foo=123', 'bar'), HeaderUtils::split('foo=123, bar', ','));
- $this->assertSame(array(array('foo=123', 'bar')), HeaderUtils::split('foo=123; bar', ',;'));
- $this->assertSame(array(array('foo=123'), array('bar')), HeaderUtils::split('foo=123, bar', ',;'));
- $this->assertSame(array('foo', '123, bar'), HeaderUtils::split('foo=123, bar', '='));
- $this->assertSame(array('foo', '123, bar'), HeaderUtils::split(' foo = 123, bar ', '='));
- $this->assertSame(array(array('foo', '123'), array('bar')), HeaderUtils::split('foo=123, bar', ',='));
- $this->assertSame(array(array(array('foo', '123')), array(array('bar'), array('foo', '456'))), HeaderUtils::split('foo=123, bar; foo=456', ',;='));
- $this->assertSame(array(array(array('foo', 'a,b;c=d'))), HeaderUtils::split('foo="a,b;c=d"', ',;='));
+ $this->assertSame(['foo=123', 'bar'], HeaderUtils::split('foo=123,bar', ','));
+ $this->assertSame(['foo=123', 'bar'], HeaderUtils::split('foo=123, bar', ','));
+ $this->assertSame([['foo=123', 'bar']], HeaderUtils::split('foo=123; bar', ',;'));
+ $this->assertSame([['foo=123'], ['bar']], HeaderUtils::split('foo=123, bar', ',;'));
+ $this->assertSame(['foo', '123, bar'], HeaderUtils::split('foo=123, bar', '='));
+ $this->assertSame(['foo', '123, bar'], HeaderUtils::split(' foo = 123, bar ', '='));
+ $this->assertSame([['foo', '123'], ['bar']], HeaderUtils::split('foo=123, bar', ',='));
+ $this->assertSame([[['foo', '123']], [['bar'], ['foo', '456']]], HeaderUtils::split('foo=123, bar; foo=456', ',;='));
+ $this->assertSame([[['foo', 'a,b;c=d']]], HeaderUtils::split('foo="a,b;c=d"', ',;='));
- $this->assertSame(array('foo', 'bar'), HeaderUtils::split('foo,,,, bar', ','));
- $this->assertSame(array('foo', 'bar'), HeaderUtils::split(',foo, bar,', ','));
- $this->assertSame(array('foo', 'bar'), HeaderUtils::split(' , foo, bar, ', ','));
- $this->assertSame(array('foo bar'), HeaderUtils::split('foo "bar"', ','));
- $this->assertSame(array('foo bar'), HeaderUtils::split('"foo" bar', ','));
- $this->assertSame(array('foo bar'), HeaderUtils::split('"foo" "bar"', ','));
+ $this->assertSame(['foo', 'bar'], HeaderUtils::split('foo,,,, bar', ','));
+ $this->assertSame(['foo', 'bar'], HeaderUtils::split(',foo, bar,', ','));
+ $this->assertSame(['foo', 'bar'], HeaderUtils::split(' , foo, bar, ', ','));
+ $this->assertSame(['foo bar'], HeaderUtils::split('foo "bar"', ','));
+ $this->assertSame(['foo bar'], HeaderUtils::split('"foo" bar', ','));
+ $this->assertSame(['foo bar'], HeaderUtils::split('"foo" "bar"', ','));
// These are not a valid header values. We test that they parse anyway,
// and that both the valid and invalid parts are returned.
- $this->assertSame(array(), HeaderUtils::split('', ','));
- $this->assertSame(array(), HeaderUtils::split(',,,', ','));
- $this->assertSame(array('foo', 'bar', 'baz'), HeaderUtils::split('foo, "bar", "baz', ','));
- $this->assertSame(array('foo', 'bar, baz'), HeaderUtils::split('foo, "bar, baz', ','));
- $this->assertSame(array('foo', 'bar, baz\\'), HeaderUtils::split('foo, "bar, baz\\', ','));
- $this->assertSame(array('foo', 'bar, baz\\'), HeaderUtils::split('foo, "bar, baz\\\\', ','));
+ $this->assertSame([], HeaderUtils::split('', ','));
+ $this->assertSame([], HeaderUtils::split(',,,', ','));
+ $this->assertSame(['foo', 'bar', 'baz'], HeaderUtils::split('foo, "bar", "baz', ','));
+ $this->assertSame(['foo', 'bar, baz'], HeaderUtils::split('foo, "bar, baz', ','));
+ $this->assertSame(['foo', 'bar, baz\\'], HeaderUtils::split('foo, "bar, baz\\', ','));
+ $this->assertSame(['foo', 'bar, baz\\'], HeaderUtils::split('foo, "bar, baz\\\\', ','));
}
public function testCombine()
{
- $this->assertSame(array('foo' => '123'), HeaderUtils::combine(array(array('foo', '123'))));
- $this->assertSame(array('foo' => true), HeaderUtils::combine(array(array('foo'))));
- $this->assertSame(array('foo' => true), HeaderUtils::combine(array(array('Foo'))));
- $this->assertSame(array('foo' => '123', 'bar' => true), HeaderUtils::combine(array(array('foo', '123'), array('bar'))));
+ $this->assertSame(['foo' => '123'], HeaderUtils::combine([['foo', '123']]));
+ $this->assertSame(['foo' => true], HeaderUtils::combine([['foo']]));
+ $this->assertSame(['foo' => true], HeaderUtils::combine([['Foo']]));
+ $this->assertSame(['foo' => '123', 'bar' => true], HeaderUtils::combine([['foo', '123'], ['bar']]));
}
public function testToString()
{
- $this->assertSame('foo', HeaderUtils::toString(array('foo' => true), ','));
- $this->assertSame('foo; bar', HeaderUtils::toString(array('foo' => true, 'bar' => true), ';'));
- $this->assertSame('foo=123', HeaderUtils::toString(array('foo' => '123'), ','));
- $this->assertSame('foo="1 2 3"', HeaderUtils::toString(array('foo' => '1 2 3'), ','));
- $this->assertSame('foo="1 2 3", bar', HeaderUtils::toString(array('foo' => '1 2 3', 'bar' => true), ','));
+ $this->assertSame('foo', HeaderUtils::toString(['foo' => true], ','));
+ $this->assertSame('foo; bar', HeaderUtils::toString(['foo' => true, 'bar' => true], ';'));
+ $this->assertSame('foo=123', HeaderUtils::toString(['foo' => '123'], ','));
+ $this->assertSame('foo="1 2 3"', HeaderUtils::toString(['foo' => '1 2 3'], ','));
+ $this->assertSame('foo="1 2 3", bar', HeaderUtils::toString(['foo' => '1 2 3', 'bar' => true], ','));
}
public function testQuote()
@@ -101,14 +101,14 @@ class HeaderUtilsTest extends TestCase
public function provideMakeDisposition()
{
- return array(
- array('attachment', 'foo.html', 'foo.html', 'attachment; filename=foo.html'),
- array('attachment', 'foo.html', '', 'attachment; filename=foo.html'),
- array('attachment', 'foo bar.html', '', 'attachment; filename="foo bar.html"'),
- array('attachment', 'foo "bar".html', '', 'attachment; filename="foo \\"bar\\".html"'),
- array('attachment', 'foo%20bar.html', 'foo bar.html', 'attachment; filename="foo bar.html"; filename*=utf-8\'\'foo%2520bar.html'),
- array('attachment', 'föö.html', 'foo.html', 'attachment; filename=foo.html; filename*=utf-8\'\'f%C3%B6%C3%B6.html'),
- );
+ return [
+ ['attachment', 'foo.html', 'foo.html', 'attachment; filename=foo.html'],
+ ['attachment', 'foo.html', '', 'attachment; filename=foo.html'],
+ ['attachment', 'foo bar.html', '', 'attachment; filename="foo bar.html"'],
+ ['attachment', 'foo "bar".html', '', 'attachment; filename="foo \\"bar\\".html"'],
+ ['attachment', 'foo%20bar.html', 'foo bar.html', 'attachment; filename="foo bar.html"; filename*=utf-8\'\'foo%2520bar.html'],
+ ['attachment', 'föö.html', 'foo.html', 'attachment; filename=foo.html; filename*=utf-8\'\'f%C3%B6%C3%B6.html'],
+ ];
}
/**
@@ -122,13 +122,13 @@ class HeaderUtilsTest extends TestCase
public function provideMakeDispositionFail()
{
- return array(
- array('attachment', 'foo%20bar.html'),
- array('attachment', 'foo/bar.html'),
- array('attachment', '/foo.html'),
- array('attachment', 'foo\bar.html'),
- array('attachment', '\foo.html'),
- array('attachment', 'föö.html'),
- );
+ return [
+ ['attachment', 'foo%20bar.html'],
+ ['attachment', 'foo/bar.html'],
+ ['attachment', '/foo.html'],
+ ['attachment', 'foo\bar.html'],
+ ['attachment', '\foo.html'],
+ ['attachment', 'föö.html'],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/IpUtilsTest.php b/vendor/symfony/http-foundation/Tests/IpUtilsTest.php
index 232a2040ff..c7f76b5de2 100644
--- a/vendor/symfony/http-foundation/Tests/IpUtilsTest.php
+++ b/vendor/symfony/http-foundation/Tests/IpUtilsTest.php
@@ -26,20 +26,20 @@ class IpUtilsTest extends TestCase
public function getIpv4Data()
{
- return array(
- array(true, '192.168.1.1', '192.168.1.1'),
- array(true, '192.168.1.1', '192.168.1.1/1'),
- array(true, '192.168.1.1', '192.168.1.0/24'),
- array(false, '192.168.1.1', '1.2.3.4/1'),
- array(false, '192.168.1.1', '192.168.1.1/33'), // invalid subnet
- array(true, '192.168.1.1', array('1.2.3.4/1', '192.168.1.0/24')),
- array(true, '192.168.1.1', array('192.168.1.0/24', '1.2.3.4/1')),
- array(false, '192.168.1.1', array('1.2.3.4/1', '4.3.2.1/1')),
- array(true, '1.2.3.4', '0.0.0.0/0'),
- array(true, '1.2.3.4', '192.168.1.0/0'),
- array(false, '1.2.3.4', '256.256.256/0'), // invalid CIDR notation
- array(false, 'an_invalid_ip', '192.168.1.0/24'),
- );
+ return [
+ [true, '192.168.1.1', '192.168.1.1'],
+ [true, '192.168.1.1', '192.168.1.1/1'],
+ [true, '192.168.1.1', '192.168.1.0/24'],
+ [false, '192.168.1.1', '1.2.3.4/1'],
+ [false, '192.168.1.1', '192.168.1.1/33'], // invalid subnet
+ [true, '192.168.1.1', ['1.2.3.4/1', '192.168.1.0/24']],
+ [true, '192.168.1.1', ['192.168.1.0/24', '1.2.3.4/1']],
+ [false, '192.168.1.1', ['1.2.3.4/1', '4.3.2.1/1']],
+ [true, '1.2.3.4', '0.0.0.0/0'],
+ [true, '1.2.3.4', '192.168.1.0/0'],
+ [false, '1.2.3.4', '256.256.256/0'], // invalid CIDR notation
+ [false, 'an_invalid_ip', '192.168.1.0/24'],
+ ];
}
/**
@@ -56,20 +56,20 @@ class IpUtilsTest extends TestCase
public function getIpv6Data()
{
- return array(
- array(true, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'),
- array(false, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'),
- array(false, '2a01:198:603:0:396e:4789:8e99:890f', '::1'),
- array(true, '0:0:0:0:0:0:0:1', '::1'),
- array(false, '0:0:603:0:396e:4789:8e99:0001', '::1'),
- array(true, '0:0:603:0:396e:4789:8e99:0001', '::/0'),
- array(true, '0:0:603:0:396e:4789:8e99:0001', '2a01:198:603:0::/0'),
- array(true, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '2a01:198:603:0::/65')),
- array(true, '2a01:198:603:0:396e:4789:8e99:890f', array('2a01:198:603:0::/65', '::1')),
- array(false, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '1a01:198:603:0::/65')),
- array(false, '}__test|O:21:&quot;JDatabaseDriverMysqli&quot;:3:{s:2', '::1'),
- array(false, '2a01:198:603:0:396e:4789:8e99:890f', 'unknown'),
- );
+ return [
+ [true, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'],
+ [false, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'],
+ [false, '2a01:198:603:0:396e:4789:8e99:890f', '::1'],
+ [true, '0:0:0:0:0:0:0:1', '::1'],
+ [false, '0:0:603:0:396e:4789:8e99:0001', '::1'],
+ [true, '0:0:603:0:396e:4789:8e99:0001', '::/0'],
+ [true, '0:0:603:0:396e:4789:8e99:0001', '2a01:198:603:0::/0'],
+ [true, '2a01:198:603:0:396e:4789:8e99:890f', ['::1', '2a01:198:603:0::/65']],
+ [true, '2a01:198:603:0:396e:4789:8e99:890f', ['2a01:198:603:0::/65', '::1']],
+ [false, '2a01:198:603:0:396e:4789:8e99:890f', ['::1', '1a01:198:603:0::/65']],
+ [false, '}__test|O:21:&quot;JDatabaseDriverMysqli&quot;:3:{s:2', '::1'],
+ [false, '2a01:198:603:0:396e:4789:8e99:890f', 'unknown'],
+ ];
}
/**
@@ -95,10 +95,10 @@ class IpUtilsTest extends TestCase
public function invalidIpAddressData()
{
- return array(
- 'invalid proxy wildcard' => array('192.168.20.13', '*'),
- 'invalid proxy missing netmask' => array('192.168.20.13', '0.0.0.0'),
- 'invalid request IP with invalid proxy wildcard' => array('0.0.0.0', '*'),
- );
+ return [
+ 'invalid proxy wildcard' => ['192.168.20.13', '*'],
+ 'invalid proxy missing netmask' => ['192.168.20.13', '0.0.0.0'],
+ 'invalid request IP with invalid proxy wildcard' => ['0.0.0.0', '*'],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/JsonResponseTest.php b/vendor/symfony/http-foundation/Tests/JsonResponseTest.php
index 201839f89c..03a7b7d9b8 100644
--- a/vendor/symfony/http-foundation/Tests/JsonResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/JsonResponseTest.php
@@ -24,13 +24,13 @@ class JsonResponseTest extends TestCase
public function testConstructorWithArrayCreatesJsonArray()
{
- $response = new JsonResponse(array(0, 1, 2, 3));
+ $response = new JsonResponse([0, 1, 2, 3]);
$this->assertSame('[0,1,2,3]', $response->getContent());
}
public function testConstructorWithAssocArrayCreatesJsonObject()
{
- $response = new JsonResponse(array('foo' => 'bar'));
+ $response = new JsonResponse(['foo' => 'bar']);
$this->assertSame('{"foo":"bar"}', $response->getContent());
}
@@ -51,7 +51,7 @@ class JsonResponseTest extends TestCase
public function testConstructorWithCustomStatus()
{
- $response = new JsonResponse(array(), 202);
+ $response = new JsonResponse([], 202);
$this->assertSame(202, $response->getStatusCode());
}
@@ -63,35 +63,35 @@ class JsonResponseTest extends TestCase
public function testConstructorWithCustomHeaders()
{
- $response = new JsonResponse(array(), 200, array('ETag' => 'foo'));
+ $response = new JsonResponse([], 200, ['ETag' => 'foo']);
$this->assertSame('application/json', $response->headers->get('Content-Type'));
$this->assertSame('foo', $response->headers->get('ETag'));
}
public function testConstructorWithCustomContentType()
{
- $headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json');
+ $headers = ['Content-Type' => 'application/vnd.acme.blog-v1+json'];
- $response = new JsonResponse(array(), 200, $headers);
+ $response = new JsonResponse([], 200, $headers);
$this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type'));
}
public function testSetJson()
{
- $response = new JsonResponse('1', 200, array(), true);
+ $response = new JsonResponse('1', 200, [], true);
$this->assertEquals('1', $response->getContent());
- $response = new JsonResponse('[1]', 200, array(), true);
+ $response = new JsonResponse('[1]', 200, [], true);
$this->assertEquals('[1]', $response->getContent());
- $response = new JsonResponse(null, 200, array());
+ $response = new JsonResponse(null, 200, []);
$response->setJson('true');
$this->assertEquals('true', $response->getContent());
}
public function testCreate()
{
- $response = JsonResponse::create(array('foo' => 'bar'), 204);
+ $response = JsonResponse::create(['foo' => 'bar'], 204);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertEquals('{"foo":"bar"}', $response->getContent());
@@ -107,14 +107,14 @@ class JsonResponseTest extends TestCase
public function testStaticCreateJsonArray()
{
- $response = JsonResponse::create(array(0, 1, 2, 3));
+ $response = JsonResponse::create([0, 1, 2, 3]);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertSame('[0,1,2,3]', $response->getContent());
}
public function testStaticCreateJsonObject()
{
- $response = JsonResponse::create(array('foo' => 'bar'));
+ $response = JsonResponse::create(['foo' => 'bar']);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertSame('{"foo":"bar"}', $response->getContent());
}
@@ -140,7 +140,7 @@ class JsonResponseTest extends TestCase
public function testStaticCreateWithCustomStatus()
{
- $response = JsonResponse::create(array(), 202);
+ $response = JsonResponse::create([], 202);
$this->assertSame(202, $response->getStatusCode());
}
@@ -152,22 +152,22 @@ class JsonResponseTest extends TestCase
public function testStaticCreateWithCustomHeaders()
{
- $response = JsonResponse::create(array(), 200, array('ETag' => 'foo'));
+ $response = JsonResponse::create([], 200, ['ETag' => 'foo']);
$this->assertSame('application/json', $response->headers->get('Content-Type'));
$this->assertSame('foo', $response->headers->get('ETag'));
}
public function testStaticCreateWithCustomContentType()
{
- $headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json');
+ $headers = ['Content-Type' => 'application/vnd.acme.blog-v1+json'];
- $response = JsonResponse::create(array(), 200, $headers);
+ $response = JsonResponse::create([], 200, $headers);
$this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type'));
}
public function testSetCallback()
{
- $response = JsonResponse::create(array('foo' => 'bar'))->setCallback('callback');
+ $response = JsonResponse::create(['foo' => 'bar'])->setCallback('callback');
$this->assertEquals('/**/callback({"foo":"bar"});', $response->getContent());
$this->assertEquals('text/javascript', $response->headers->get('Content-Type'));
@@ -190,7 +190,7 @@ class JsonResponseTest extends TestCase
public function testSetEncodingOptions()
{
$response = new JsonResponse();
- $response->setData(array(array(1, 2, 3)));
+ $response->setData([[1, 2, 3]]);
$this->assertEquals('[[1,2,3]]', $response->getContent());
@@ -239,7 +239,7 @@ class JsonResponseTest extends TestCase
public function testSetComplexCallback()
{
- $response = JsonResponse::create(array('foo' => 'bar'));
+ $response = JsonResponse::create(['foo' => 'bar']);
$response->setCallback('ಠ_ಠ["foo"].bar[0]');
$this->assertEquals('/**/ಠ_ಠ["foo"].bar[0]({"foo":"bar"});', $response->getContent());
diff --git a/vendor/symfony/http-foundation/Tests/ParameterBagTest.php b/vendor/symfony/http-foundation/Tests/ParameterBagTest.php
index dccfd4f308..d2a5c991cc 100644
--- a/vendor/symfony/http-foundation/Tests/ParameterBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/ParameterBagTest.php
@@ -23,44 +23,44 @@ class ParameterBagTest extends TestCase
public function testAll()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
- $this->assertEquals(array('foo' => 'bar'), $bag->all(), '->all() gets all the input');
+ $bag = new ParameterBag(['foo' => 'bar']);
+ $this->assertEquals(['foo' => 'bar'], $bag->all(), '->all() gets all the input');
}
public function testKeys()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
- $this->assertEquals(array('foo'), $bag->keys());
+ $bag = new ParameterBag(['foo' => 'bar']);
+ $this->assertEquals(['foo'], $bag->keys());
}
public function testAdd()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
- $bag->add(array('bar' => 'bas'));
- $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all());
+ $bag = new ParameterBag(['foo' => 'bar']);
+ $bag->add(['bar' => 'bas']);
+ $this->assertEquals(['foo' => 'bar', 'bar' => 'bas'], $bag->all());
}
public function testRemove()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
- $bag->add(array('bar' => 'bas'));
- $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all());
+ $bag = new ParameterBag(['foo' => 'bar']);
+ $bag->add(['bar' => 'bas']);
+ $this->assertEquals(['foo' => 'bar', 'bar' => 'bas'], $bag->all());
$bag->remove('bar');
- $this->assertEquals(array('foo' => 'bar'), $bag->all());
+ $this->assertEquals(['foo' => 'bar'], $bag->all());
}
public function testReplace()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
+ $bag = new ParameterBag(['foo' => 'bar']);
- $bag->replace(array('FOO' => 'BAR'));
- $this->assertEquals(array('FOO' => 'BAR'), $bag->all(), '->replace() replaces the input with the argument');
+ $bag->replace(['FOO' => 'BAR']);
+ $this->assertEquals(['FOO' => 'BAR'], $bag->all(), '->replace() replaces the input with the argument');
$this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input');
}
public function testGet()
{
- $bag = new ParameterBag(array('foo' => 'bar', 'null' => null));
+ $bag = new ParameterBag(['foo' => 'bar', 'null' => null]);
$this->assertEquals('bar', $bag->get('foo'), '->get() gets the value of a parameter');
$this->assertEquals('default', $bag->get('unknown', 'default'), '->get() returns second argument as default if a parameter is not defined');
@@ -69,14 +69,14 @@ class ParameterBagTest extends TestCase
public function testGetDoesNotUseDeepByDefault()
{
- $bag = new ParameterBag(array('foo' => array('bar' => 'moo')));
+ $bag = new ParameterBag(['foo' => ['bar' => 'moo']]);
$this->assertNull($bag->get('foo[bar]'));
}
public function testSet()
{
- $bag = new ParameterBag(array());
+ $bag = new ParameterBag([]);
$bag->set('foo', 'bar');
$this->assertEquals('bar', $bag->get('foo'), '->set() sets the value of parameter');
@@ -87,7 +87,7 @@ class ParameterBagTest extends TestCase
public function testHas()
{
- $bag = new ParameterBag(array('foo' => 'bar'));
+ $bag = new ParameterBag(['foo' => 'bar']);
$this->assertTrue($bag->has('foo'), '->has() returns true if a parameter is defined');
$this->assertFalse($bag->has('unknown'), '->has() return false if a parameter is not defined');
@@ -95,7 +95,7 @@ class ParameterBagTest extends TestCase
public function testGetAlpha()
{
- $bag = new ParameterBag(array('word' => 'foo_BAR_012'));
+ $bag = new ParameterBag(['word' => 'foo_BAR_012']);
$this->assertEquals('fooBAR', $bag->getAlpha('word'), '->getAlpha() gets only alphabetic characters');
$this->assertEquals('', $bag->getAlpha('unknown'), '->getAlpha() returns empty string if a parameter is not defined');
@@ -103,7 +103,7 @@ class ParameterBagTest extends TestCase
public function testGetAlnum()
{
- $bag = new ParameterBag(array('word' => 'foo_BAR_012'));
+ $bag = new ParameterBag(['word' => 'foo_BAR_012']);
$this->assertEquals('fooBAR012', $bag->getAlnum('word'), '->getAlnum() gets only alphanumeric characters');
$this->assertEquals('', $bag->getAlnum('unknown'), '->getAlnum() returns empty string if a parameter is not defined');
@@ -111,7 +111,7 @@ class ParameterBagTest extends TestCase
public function testGetDigits()
{
- $bag = new ParameterBag(array('word' => 'foo_BAR_012'));
+ $bag = new ParameterBag(['word' => 'foo_BAR_012']);
$this->assertEquals('012', $bag->getDigits('word'), '->getDigits() gets only digits as string');
$this->assertEquals('', $bag->getDigits('unknown'), '->getDigits() returns empty string if a parameter is not defined');
@@ -119,7 +119,7 @@ class ParameterBagTest extends TestCase
public function testGetInt()
{
- $bag = new ParameterBag(array('digits' => '0123'));
+ $bag = new ParameterBag(['digits' => '0123']);
$this->assertEquals(123, $bag->getInt('digits'), '->getInt() gets a value of parameter as integer');
$this->assertEquals(0, $bag->getInt('unknown'), '->getInt() returns zero if a parameter is not defined');
@@ -127,14 +127,14 @@ class ParameterBagTest extends TestCase
public function testFilter()
{
- $bag = new ParameterBag(array(
+ $bag = new ParameterBag([
'digits' => '0123ab',
'email' => 'example@example.com',
'url' => 'http://example.com/foo',
'dec' => '256',
'hex' => '0x100',
- 'array' => array('bang'),
- ));
+ 'array' => ['bang'],
+ ]);
$this->assertEmpty($bag->filter('nokey'), '->filter() should return empty by default if no key is found');
@@ -142,27 +142,27 @@ class ParameterBagTest extends TestCase
$this->assertEquals('example@example.com', $bag->filter('email', '', FILTER_VALIDATE_EMAIL), '->filter() gets a value of parameter as email');
- $this->assertEquals('http://example.com/foo', $bag->filter('url', '', FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as URL with a path');
+ $this->assertEquals('http://example.com/foo', $bag->filter('url', '', FILTER_VALIDATE_URL, ['flags' => FILTER_FLAG_PATH_REQUIRED]), '->filter() gets a value of parameter as URL with a path');
// This test is repeated for code-coverage
$this->assertEquals('http://example.com/foo', $bag->filter('url', '', FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as URL with a path');
- $this->assertFalse($bag->filter('dec', '', FILTER_VALIDATE_INT, array(
+ $this->assertFalse($bag->filter('dec', '', FILTER_VALIDATE_INT, [
'flags' => FILTER_FLAG_ALLOW_HEX,
- 'options' => array('min_range' => 1, 'max_range' => 0xff),
- )), '->filter() gets a value of parameter as integer between boundaries');
+ 'options' => ['min_range' => 1, 'max_range' => 0xff],
+ ]), '->filter() gets a value of parameter as integer between boundaries');
- $this->assertFalse($bag->filter('hex', '', FILTER_VALIDATE_INT, array(
+ $this->assertFalse($bag->filter('hex', '', FILTER_VALIDATE_INT, [
'flags' => FILTER_FLAG_ALLOW_HEX,
- 'options' => array('min_range' => 1, 'max_range' => 0xff),
- )), '->filter() gets a value of parameter as integer between boundaries');
+ 'options' => ['min_range' => 1, 'max_range' => 0xff],
+ ]), '->filter() gets a value of parameter as integer between boundaries');
- $this->assertEquals(array('bang'), $bag->filter('array', ''), '->filter() gets a value of parameter as an array');
+ $this->assertEquals(['bang'], $bag->filter('array', ''), '->filter() gets a value of parameter as an array');
}
public function testGetIterator()
{
- $parameters = array('foo' => 'bar', 'hello' => 'world');
+ $parameters = ['foo' => 'bar', 'hello' => 'world'];
$bag = new ParameterBag($parameters);
$i = 0;
@@ -176,7 +176,7 @@ class ParameterBagTest extends TestCase
public function testCount()
{
- $parameters = array('foo' => 'bar', 'hello' => 'world');
+ $parameters = ['foo' => 'bar', 'hello' => 'world'];
$bag = new ParameterBag($parameters);
$this->assertCount(\count($parameters), $bag);
@@ -184,7 +184,7 @@ class ParameterBagTest extends TestCase
public function testGetBoolean()
{
- $parameters = array('string_true' => 'true', 'string_false' => 'false');
+ $parameters = ['string_true' => 'true', 'string_false' => 'false'];
$bag = new ParameterBag($parameters);
$this->assertTrue($bag->getBoolean('string_true'), '->getBoolean() gets the string true as boolean true');
diff --git a/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php b/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php
index d389e83dbe..64c3e73ee2 100644
--- a/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php
@@ -22,7 +22,7 @@ class RedirectResponseTest extends TestCase
$this->assertEquals(1, preg_match(
'#<meta http-equiv="refresh" content="\d+;url=foo\.bar" />#',
- preg_replace(array('/\s+/', '/\'/'), array(' ', '"'), $response->getContent())
+ preg_replace(['/\s+/', '/\'/'], [' ', '"'], $response->getContent())
));
}
@@ -87,7 +87,7 @@ class RedirectResponseTest extends TestCase
$response = new RedirectResponse('foo.bar', 301);
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
- $response = new RedirectResponse('foo.bar', 301, array('cache-control' => 'max-age=86400'));
+ $response = new RedirectResponse('foo.bar', 301, ['cache-control' => 'max-age=86400']);
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
$this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
diff --git a/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php b/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
index cc35ad637b..57e9c3d30f 100644
--- a/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
+++ b/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
@@ -34,20 +34,20 @@ class RequestMatcherTest extends TestCase
public function getMethodData()
{
- return array(
- array('get', 'get', true),
- array('get', array('get', 'post'), true),
- array('get', 'post', false),
- array('get', 'GET', true),
- array('get', array('GET', 'POST'), true),
- array('get', 'POST', false),
- );
+ return [
+ ['get', 'get', true],
+ ['get', ['get', 'post'], true],
+ ['get', 'post', false],
+ ['get', 'GET', true],
+ ['get', ['GET', 'POST'], true],
+ ['get', 'POST', false],
+ ];
}
public function testScheme()
{
$httpRequest = $request = $request = Request::create('');
- $httpsRequest = $request = $request = Request::create('', 'get', array(), array(), array(), array('HTTPS' => 'on'));
+ $httpsRequest = $request = $request = Request::create('', 'get', [], [], [], ['HTTPS' => 'on']);
$matcher = new RequestMatcher();
$matcher->matchScheme('https');
@@ -69,7 +69,7 @@ class RequestMatcherTest extends TestCase
public function testHost($pattern, $isMatch)
{
$matcher = new RequestMatcher();
- $request = Request::create('', 'get', array(), array(), array(), array('HTTP_HOST' => 'foo.example.com'));
+ $request = Request::create('', 'get', [], [], [], ['HTTP_HOST' => 'foo.example.com']);
$matcher->matchHost($pattern);
$this->assertSame($isMatch, $matcher->matches($request));
@@ -81,7 +81,7 @@ class RequestMatcherTest extends TestCase
public function testPort()
{
$matcher = new RequestMatcher();
- $request = Request::create('', 'get', array(), array(), array(), array('HTTP_HOST' => null, 'SERVER_PORT' => 8000));
+ $request = Request::create('', 'get', [], [], [], ['HTTP_HOST' => null, 'SERVER_PORT' => 8000]);
$matcher->matchPort(8000);
$this->assertTrue($matcher->matches($request));
@@ -89,22 +89,22 @@ class RequestMatcherTest extends TestCase
$matcher->matchPort(9000);
$this->assertFalse($matcher->matches($request));
- $matcher = new RequestMatcher(null, null, null, null, array(), null, 8000);
+ $matcher = new RequestMatcher(null, null, null, null, [], null, 8000);
$this->assertTrue($matcher->matches($request));
}
public function getHostData()
{
- return array(
- array('.*\.example\.com', true),
- array('\.example\.com$', true),
- array('^.*\.example\.com$', true),
- array('.*\.sensio\.com', false),
- array('.*\.example\.COM', true),
- array('\.example\.COM$', true),
- array('^.*\.example\.COM$', true),
- array('.*\.sensio\.COM', false),
- );
+ return [
+ ['.*\.example\.com', true],
+ ['\.example\.com$', true],
+ ['^.*\.example\.com$', true],
+ ['.*\.sensio\.com', false],
+ ['.*\.example\.COM', true],
+ ['\.example\.COM$', true],
+ ['^.*\.example\.COM$', true],
+ ['.*\.sensio\.COM', false],
+ ];
}
public function testPath()
diff --git a/vendor/symfony/http-foundation/Tests/RequestTest.php b/vendor/symfony/http-foundation/Tests/RequestTest.php
index 36a9491348..ab0dcf6818 100644
--- a/vendor/symfony/http-foundation/Tests/RequestTest.php
+++ b/vendor/symfony/http-foundation/Tests/RequestTest.php
@@ -21,24 +21,24 @@ class RequestTest extends TestCase
{
protected function tearDown()
{
- Request::setTrustedProxies(array(), -1);
- Request::setTrustedHosts(array());
+ Request::setTrustedProxies([], -1);
+ Request::setTrustedHosts([]);
}
public function testInitialize()
{
$request = new Request();
- $request->initialize(array('foo' => 'bar'));
+ $request->initialize(['foo' => 'bar']);
$this->assertEquals('bar', $request->query->get('foo'), '->initialize() takes an array of query parameters as its first argument');
- $request->initialize(array(), array('foo' => 'bar'));
+ $request->initialize([], ['foo' => 'bar']);
$this->assertEquals('bar', $request->request->get('foo'), '->initialize() takes an array of request parameters as its second argument');
- $request->initialize(array(), array(), array('foo' => 'bar'));
+ $request->initialize([], [], ['foo' => 'bar']);
$this->assertEquals('bar', $request->attributes->get('foo'), '->initialize() takes an array of attributes as its third argument');
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_FOO' => 'bar'));
+ $request->initialize([], [], [], [], [], ['HTTP_FOO' => 'bar']);
$this->assertEquals('bar', $request->headers->get('FOO'), '->initialize() takes an array of HTTP headers as its sixth argument');
}
@@ -101,7 +101,7 @@ class RequestTest extends TestCase
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertFalse($request->isSecure());
- $request = Request::create('http://test.com/foo', 'GET', array('bar' => 'baz'));
+ $request = Request::create('http://test.com/foo', 'GET', ['bar' => 'baz']);
$this->assertEquals('http://test.com/foo?bar=baz', $request->getUri());
$this->assertEquals('/foo', $request->getPathInfo());
$this->assertEquals('bar=baz', $request->getQueryString());
@@ -109,7 +109,7 @@ class RequestTest extends TestCase
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertFalse($request->isSecure());
- $request = Request::create('http://test.com/foo?bar=foo', 'GET', array('bar' => 'baz'));
+ $request = Request::create('http://test.com/foo?bar=foo', 'GET', ['bar' => 'baz']);
$this->assertEquals('http://test.com/foo?bar=baz', $request->getUri());
$this->assertEquals('/foo', $request->getPathInfo());
$this->assertEquals('bar=baz', $request->getQueryString());
@@ -166,7 +166,7 @@ class RequestTest extends TestCase
$this->assertTrue($request->isSecure());
$json = '{"jsonrpc":"2.0","method":"echo","id":7,"params":["Hello World"]}';
- $request = Request::create('http://example.com/jsonrpc', 'POST', array(), array(), array(), array(), $json);
+ $request = Request::create('http://example.com/jsonrpc', 'POST', [], [], [], [], $json);
$this->assertEquals($json, $request->getContent());
$this->assertFalse($request->isSecure());
@@ -216,16 +216,16 @@ class RequestTest extends TestCase
$request = Request::create('http://test.com/?foo');
$this->assertEquals('/?foo', $request->getRequestUri());
- $this->assertEquals(array('foo' => ''), $request->query->all());
+ $this->assertEquals(['foo' => ''], $request->query->all());
// assume rewrite rule: (.*) --> app/app.php; app/ is a symlink to a symfony web/ directory
- $request = Request::create('http://test.com/apparthotel-1234', 'GET', array(), array(), array(),
- array(
+ $request = Request::create('http://test.com/apparthotel-1234', 'GET', [], [], [],
+ [
'DOCUMENT_ROOT' => '/var/www/www.test.com',
'SCRIPT_FILENAME' => '/var/www/www.test.com/app/app.php',
'SCRIPT_NAME' => '/app/app.php',
'PHP_SELF' => '/app/app.php/apparthotel-1234',
- ));
+ ]);
$this->assertEquals('http://test.com/apparthotel-1234', $request->getUri());
$this->assertEquals('/apparthotel-1234', $request->getPathInfo());
$this->assertEquals('', $request->getQueryString());
@@ -258,7 +258,7 @@ class RequestTest extends TestCase
$this->assertEquals(8080, $request->getPort());
$this->assertFalse($request->isSecure());
- $request = Request::create('http://test.com/foo?bar=foo', 'GET', array('bar' => 'baz'));
+ $request = Request::create('http://test.com/foo?bar=foo', 'GET', ['bar' => 'baz']);
$request->server->set('REQUEST_URI', 'http://test.com/foo?bar=foo');
$this->assertEquals('http://test.com/foo?bar=baz', $request->getUri());
$this->assertEquals('/foo', $request->getPathInfo());
@@ -289,13 +289,13 @@ class RequestTest extends TestCase
public function testGetRequestUri($serverRequestUri, $expected, $message)
{
$request = new Request();
- $request->server->add(array(
+ $request->server->add([
'REQUEST_URI' => $serverRequestUri,
// For having http://test.com
'SERVER_NAME' => 'test.com',
'SERVER_PORT' => 80,
- ));
+ ]);
$this->assertSame($expected, $request->getRequestUri(), $message);
$this->assertSame($expected, $request->server->get('REQUEST_URI'), 'Normalize the request URI.');
@@ -304,21 +304,21 @@ class RequestTest extends TestCase
public function getRequestUriData()
{
$message = 'Do not modify the path.';
- yield array('/foo', '/foo', $message);
- yield array('//bar/foo', '//bar/foo', $message);
- yield array('///bar/foo', '///bar/foo', $message);
+ yield ['/foo', '/foo', $message];
+ yield ['//bar/foo', '//bar/foo', $message];
+ yield ['///bar/foo', '///bar/foo', $message];
$message = 'Handle when the scheme, host are on REQUEST_URI.';
- yield array('http://test.com/foo?bar=baz', '/foo?bar=baz', $message);
+ yield ['http://test.com/foo?bar=baz', '/foo?bar=baz', $message];
$message = 'Handle when the scheme, host and port are on REQUEST_URI.';
- yield array('http://test.com:80/foo', '/foo', $message);
- yield array('https://test.com:8080/foo', '/foo', $message);
- yield array('https://test.com:443/foo', '/foo', $message);
+ yield ['http://test.com:80/foo', '/foo', $message];
+ yield ['https://test.com:8080/foo', '/foo', $message];
+ yield ['https://test.com:443/foo', '/foo', $message];
$message = 'Fragment should not be included in the URI';
- yield array('http://test.com/foo#bar', '/foo', $message);
- yield array('/foo#bar', '/foo', $message);
+ yield ['http://test.com/foo#bar', '/foo', $message];
+ yield ['/foo#bar', '/foo', $message];
}
public function testGetRequestUriWithoutRequiredHeader()
@@ -335,7 +335,7 @@ class RequestTest extends TestCase
public function testCreateCheckPrecedence()
{
// server is used by default
- $request = Request::create('/', 'DELETE', array(), array(), array(), array(
+ $request = Request::create('/', 'DELETE', [], [], [], [
'HTTP_HOST' => 'example.com',
'HTTPS' => 'on',
'SERVER_PORT' => 443,
@@ -343,7 +343,7 @@ class RequestTest extends TestCase
'PHP_AUTH_PW' => 'pa$$',
'QUERY_STRING' => 'foo=bar',
'CONTENT_TYPE' => 'application/json',
- ));
+ ]);
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(443, $request->getPort());
$this->assertTrue($request->isSecure());
@@ -353,11 +353,11 @@ class RequestTest extends TestCase
$this->assertEquals('application/json', $request->headers->get('CONTENT_TYPE'));
// URI has precedence over server
- $request = Request::create('http://thomas:pokemon@example.net:8080/?foo=bar', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://thomas:pokemon@example.net:8080/?foo=bar', 'GET', [], [], [], [
'HTTP_HOST' => 'example.com',
'HTTPS' => 'on',
'SERVER_PORT' => 443,
- ));
+ ]);
$this->assertEquals('example.net', $request->getHost());
$this->assertEquals(8080, $request->getPort());
$this->assertFalse($request->isSecure());
@@ -368,7 +368,7 @@ class RequestTest extends TestCase
public function testDuplicate()
{
- $request = new Request(array('foo' => 'bar'), array('foo' => 'bar'), array('foo' => 'bar'), array(), array(), array('HTTP_FOO' => 'bar'));
+ $request = new Request(['foo' => 'bar'], ['foo' => 'bar'], ['foo' => 'bar'], [], [], ['HTTP_FOO' => 'bar']);
$dup = $request->duplicate();
$this->assertEquals($request->query->all(), $dup->query->all(), '->duplicate() duplicates a request an copy the current query parameters');
@@ -376,17 +376,17 @@ class RequestTest extends TestCase
$this->assertEquals($request->attributes->all(), $dup->attributes->all(), '->duplicate() duplicates a request an copy the current attributes');
$this->assertEquals($request->headers->all(), $dup->headers->all(), '->duplicate() duplicates a request an copy the current HTTP headers');
- $dup = $request->duplicate(array('foo' => 'foobar'), array('foo' => 'foobar'), array('foo' => 'foobar'), array(), array(), array('HTTP_FOO' => 'foobar'));
+ $dup = $request->duplicate(['foo' => 'foobar'], ['foo' => 'foobar'], ['foo' => 'foobar'], [], [], ['HTTP_FOO' => 'foobar']);
- $this->assertEquals(array('foo' => 'foobar'), $dup->query->all(), '->duplicate() overrides the query parameters if provided');
- $this->assertEquals(array('foo' => 'foobar'), $dup->request->all(), '->duplicate() overrides the request parameters if provided');
- $this->assertEquals(array('foo' => 'foobar'), $dup->attributes->all(), '->duplicate() overrides the attributes if provided');
- $this->assertEquals(array('foo' => array('foobar')), $dup->headers->all(), '->duplicate() overrides the HTTP header if provided');
+ $this->assertEquals(['foo' => 'foobar'], $dup->query->all(), '->duplicate() overrides the query parameters if provided');
+ $this->assertEquals(['foo' => 'foobar'], $dup->request->all(), '->duplicate() overrides the request parameters if provided');
+ $this->assertEquals(['foo' => 'foobar'], $dup->attributes->all(), '->duplicate() overrides the attributes if provided');
+ $this->assertEquals(['foo' => ['foobar']], $dup->headers->all(), '->duplicate() overrides the HTTP header if provided');
}
public function testDuplicateWithFormat()
{
- $request = new Request(array(), array(), array('_format' => 'json'));
+ $request = new Request([], [], ['_format' => 'json']);
$dup = $request->duplicate();
$this->assertEquals('json', $dup->getRequestFormat());
@@ -421,7 +421,7 @@ class RequestTest extends TestCase
public function getFormatToMimeTypeMapProviderWithAdditionalNullFormat()
{
return array_merge(
- array(array(null, array(null, 'unexistent-mime-type'))),
+ [[null, [null, 'unexistent-mime-type']]],
$this->getFormatToMimeTypeMapProvider()
);
}
@@ -456,7 +456,7 @@ class RequestTest extends TestCase
{
$request = new Request();
$this->assertNull($request->getMimeType('foo'));
- $this->assertEquals(array(), Request::getMimeTypes('foo'));
+ $this->assertEquals([], Request::getMimeTypes('foo'));
}
public function testGetFormatWithCustomMimeType()
@@ -468,21 +468,21 @@ class RequestTest extends TestCase
public function getFormatToMimeTypeMapProvider()
{
- return array(
- array('txt', array('text/plain')),
- array('js', array('application/javascript', 'application/x-javascript', 'text/javascript')),
- array('css', array('text/css')),
- array('json', array('application/json', 'application/x-json')),
- array('jsonld', array('application/ld+json')),
- array('xml', array('text/xml', 'application/xml', 'application/x-xml')),
- array('rdf', array('application/rdf+xml')),
- array('atom', array('application/atom+xml')),
- );
+ return [
+ ['txt', ['text/plain']],
+ ['js', ['application/javascript', 'application/x-javascript', 'text/javascript']],
+ ['css', ['text/css']],
+ ['json', ['application/json', 'application/x-json']],
+ ['jsonld', ['application/ld+json']],
+ ['xml', ['text/xml', 'application/xml', 'application/x-xml']],
+ ['rdf', ['application/rdf+xml']],
+ ['atom', ['application/atom+xml']],
+ ];
}
public function testGetUri()
{
- $server = array();
+ $server = [];
// Standard Request on non default PORT
// http://host:8080/index.php/path/info?query=string
@@ -501,7 +501,7 @@ class RequestTest extends TestCase
$request = new Request();
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/index.php/path/info?query=string', $request->getUri(), '->getUri() with non default port');
@@ -510,7 +510,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host/index.php/path/info?query=string', $request->getUri(), '->getUri() with default port');
@@ -519,7 +519,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/index.php/path/info?query=string', $request->getUri(), '->getUri() with default port without HOST_HEADER');
@@ -527,7 +527,7 @@ class RequestTest extends TestCase
// RewriteCond %{REQUEST_FILENAME} !-f
// RewriteRule ^(.*)$ index.php [QSA,L]
// http://host:8080/path/info?query=string
- $server = array();
+ $server = [];
$server['HTTP_HOST'] = 'host:8080';
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '8080';
@@ -541,7 +541,7 @@ class RequestTest extends TestCase
$server['PHP_SELF'] = '/index.php';
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/path/info?query=string', $request->getUri(), '->getUri() with rewrite');
// Use std port number
@@ -550,7 +550,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host/path/info?query=string', $request->getUri(), '->getUri() with rewrite and default port');
@@ -559,13 +559,13 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/path/info?query=string', $request->getUri(), '->getUri() with rewrite, default port without HOST_HEADER');
// With encoded characters
- $server = array(
+ $server = [
'HTTP_HOST' => 'host:8080',
'SERVER_NAME' => 'servername',
'SERVER_PORT' => '8080',
@@ -575,9 +575,9 @@ class RequestTest extends TestCase
'PATH_TRANSLATED' => 'redirect:/index.php/foo bar/in+fo',
'PHP_SELF' => '/ba se/index_dev.php/path/info',
'SCRIPT_FILENAME' => '/some/where/ba se/index_dev.php',
- );
+ ];
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals(
'http://host:8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string',
@@ -587,11 +587,11 @@ class RequestTest extends TestCase
// with user info
$server['PHP_AUTH_USER'] = 'fabien';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string', $request->getUri());
$server['PHP_AUTH_PW'] = 'symfony';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string', $request->getUri());
}
@@ -609,7 +609,7 @@ class RequestTest extends TestCase
$request = Request::create('https://test.com:90/foo?bar=baz');
$this->assertEquals('https://test.com:90/some/path', $request->getUriForPath('/some/path'));
- $server = array();
+ $server = [];
// Standard Request on non default PORT
// http://host:8080/index.php/path/info?query=string
@@ -628,7 +628,7 @@ class RequestTest extends TestCase
$request = new Request();
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/index.php/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with non default port');
@@ -637,7 +637,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host/index.php/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with default port');
@@ -646,7 +646,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/index.php/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with default port without HOST_HEADER');
@@ -654,7 +654,7 @@ class RequestTest extends TestCase
// RewriteCond %{REQUEST_FILENAME} !-f
// RewriteRule ^(.*)$ index.php [QSA,L]
// http://host:8080/path/info?query=string
- $server = array();
+ $server = [];
$server['HTTP_HOST'] = 'host:8080';
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '8080';
@@ -668,7 +668,7 @@ class RequestTest extends TestCase
$server['PHP_SELF'] = '/index.php';
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host:8080/some/path', $request->getUriForPath('/some/path'), '->getUri() with rewrite');
// Use std port number
@@ -677,7 +677,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://host/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with rewrite and default port');
@@ -686,7 +686,7 @@ class RequestTest extends TestCase
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '80';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/some/path', $request->getUriForPath('/some/path'), '->getUriForPath() with rewrite, default port without HOST_HEADER');
$this->assertEquals('servername', $request->getHttpHost());
@@ -694,11 +694,11 @@ class RequestTest extends TestCase
// with user info
$server['PHP_AUTH_USER'] = 'fabien';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/some/path', $request->getUriForPath('/some/path'));
$server['PHP_AUTH_PW'] = 'symfony';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername/some/path', $request->getUriForPath('/some/path'));
}
@@ -712,30 +712,30 @@ class RequestTest extends TestCase
public function getRelativeUriForPathData()
{
- return array(
- array('me.png', '/foo', '/me.png'),
- array('../me.png', '/foo/bar', '/me.png'),
- array('me.png', '/foo/bar', '/foo/me.png'),
- array('../baz/me.png', '/foo/bar/b', '/foo/baz/me.png'),
- array('../../fooz/baz/me.png', '/foo/bar/b', '/fooz/baz/me.png'),
- array('baz/me.png', '/foo/bar/b', 'baz/me.png'),
- );
+ return [
+ ['me.png', '/foo', '/me.png'],
+ ['../me.png', '/foo/bar', '/me.png'],
+ ['me.png', '/foo/bar', '/foo/me.png'],
+ ['../baz/me.png', '/foo/bar/b', '/foo/baz/me.png'],
+ ['../../fooz/baz/me.png', '/foo/bar/b', '/fooz/baz/me.png'],
+ ['baz/me.png', '/foo/bar/b', 'baz/me.png'],
+ ];
}
public function testGetUserInfo()
{
$request = new Request();
- $server = array('PHP_AUTH_USER' => 'fabien');
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $server = ['PHP_AUTH_USER' => 'fabien'];
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('fabien', $request->getUserInfo());
$server['PHP_AUTH_USER'] = '0';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('0', $request->getUserInfo());
$server['PHP_AUTH_PW'] = '0';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('0:0', $request->getUserInfo());
}
@@ -743,22 +743,22 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array();
+ $server = [];
$server['SERVER_NAME'] = 'servername';
$server['SERVER_PORT'] = '90';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername:90', $request->getSchemeAndHttpHost());
$server['PHP_AUTH_USER'] = 'fabien';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername:90', $request->getSchemeAndHttpHost());
$server['PHP_AUTH_USER'] = '0';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername:90', $request->getSchemeAndHttpHost());
$server['PHP_AUTH_PW'] = '0';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('http://servername:90', $request->getSchemeAndHttpHost());
}
@@ -775,35 +775,35 @@ class RequestTest extends TestCase
public function getQueryStringNormalizationData()
{
- return array(
- array('foo', 'foo=', 'works with valueless parameters'),
- array('foo=', 'foo=', 'includes a dangling equal sign'),
- array('bar=&foo=bar', 'bar=&foo=bar', '->works with empty parameters'),
- array('foo=bar&bar=', 'bar=&foo=bar', 'sorts keys alphabetically'),
+ return [
+ ['foo', 'foo=', 'works with valueless parameters'],
+ ['foo=', 'foo=', 'includes a dangling equal sign'],
+ ['bar=&foo=bar', 'bar=&foo=bar', '->works with empty parameters'],
+ ['foo=bar&bar=', 'bar=&foo=bar', 'sorts keys alphabetically'],
// GET parameters, that are submitted from a HTML form, encode spaces as "+" by default (as defined in enctype application/x-www-form-urlencoded).
// PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str.
- array('him=John%20Doe&her=Jane+Doe', 'her=Jane%20Doe&him=John%20Doe', 'normalizes spaces in both encodings "%20" and "+"'),
+ ['baz=Foo%20Baz&bar=Foo+Bar', 'bar=Foo%20Bar&baz=Foo%20Baz', 'normalizes spaces in both encodings "%20" and "+"'],
- array('foo[]=1&foo[]=2', 'foo%5B0%5D=1&foo%5B1%5D=2', 'allows array notation'),
- array('foo=1&foo=2', 'foo=2', 'merges repeated parameters'),
- array('pa%3Dram=foo%26bar%3Dbaz&test=test', 'pa%3Dram=foo%26bar%3Dbaz&test=test', 'works with encoded delimiters'),
- array('0', '0=', 'allows "0"'),
- array('Jane Doe&John%20Doe', 'Jane_Doe=&John_Doe=', 'normalizes encoding in keys'),
- array('her=Jane Doe&him=John%20Doe', 'her=Jane%20Doe&him=John%20Doe', 'normalizes encoding in values'),
- array('foo=bar&&&test&&', 'foo=bar&test=', 'removes unneeded delimiters'),
- array('formula=e=m*c^2', 'formula=e%3Dm%2Ac%5E2', 'correctly treats only the first "=" as delimiter and the next as value'),
+ ['foo[]=1&foo[]=2', 'foo%5B0%5D=1&foo%5B1%5D=2', 'allows array notation'],
+ ['foo=1&foo=2', 'foo=2', 'merges repeated parameters'],
+ ['pa%3Dram=foo%26bar%3Dbaz&test=test', 'pa%3Dram=foo%26bar%3Dbaz&test=test', 'works with encoded delimiters'],
+ ['0', '0=', 'allows "0"'],
+ ['Foo Bar&Foo%20Baz', 'Foo_Bar=&Foo_Baz=', 'normalizes encoding in keys'],
+ ['bar=Foo Bar&baz=Foo%20Baz', 'bar=Foo%20Bar&baz=Foo%20Baz', 'normalizes encoding in values'],
+ ['foo=bar&&&test&&', 'foo=bar&test=', 'removes unneeded delimiters'],
+ ['formula=e=m*c^2', 'formula=e%3Dm%2Ac%5E2', 'correctly treats only the first "=" as delimiter and the next as value'],
// Ignore pairs with empty key, even if there was a value, e.g. "=value", as such nameless values cannot be retrieved anyway.
// PHP also does not include them when building _GET.
- array('foo=bar&=a=b&=x=y', 'foo=bar', 'removes params with empty key'),
+ ['foo=bar&=a=b&=x=y', 'foo=bar', 'removes params with empty key'],
// Don't reorder nested query string keys
- array('foo[]=Z&foo[]=A', 'foo%5B0%5D=Z&foo%5B1%5D=A', 'keeps order of values'),
- array('foo[Z]=B&foo[A]=B', 'foo%5BZ%5D=B&foo%5BA%5D=B', 'keeps order of keys'),
+ ['foo[]=Z&foo[]=A', 'foo%5B0%5D=Z&foo%5B1%5D=A', 'keeps order of values'],
+ ['foo[Z]=B&foo[A]=B', 'foo%5BZ%5D=B&foo%5BA%5D=B', 'keeps order of keys'],
- array('utf8=✓', 'utf8=%E2%9C%93', 'encodes UTF-8'),
- );
+ ['utf8=✓', 'utf8=%E2%9C%93', 'encodes UTF-8'],
+ ];
}
public function testGetQueryStringReturnsNull()
@@ -820,74 +820,74 @@ class RequestTest extends TestCase
{
$request = new Request();
- $request->initialize(array('foo' => 'bar'));
+ $request->initialize(['foo' => 'bar']);
$this->assertEquals('', $request->getHost(), '->getHost() return empty string if not initialized');
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.example.com'));
+ $request->initialize([], [], [], [], [], ['HTTP_HOST' => 'www.example.com']);
$this->assertEquals('www.example.com', $request->getHost(), '->getHost() from Host Header');
// Host header with port number
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.example.com:8080'));
+ $request->initialize([], [], [], [], [], ['HTTP_HOST' => 'www.example.com:8080']);
$this->assertEquals('www.example.com', $request->getHost(), '->getHost() from Host Header with port number');
// Server values
- $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.example.com'));
+ $request->initialize([], [], [], [], [], ['SERVER_NAME' => 'www.example.com']);
$this->assertEquals('www.example.com', $request->getHost(), '->getHost() from server name');
- $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.example.com', 'HTTP_HOST' => 'www.host.com'));
+ $request->initialize([], [], [], [], [], ['SERVER_NAME' => 'www.example.com', 'HTTP_HOST' => 'www.host.com']);
$this->assertEquals('www.host.com', $request->getHost(), '->getHost() value from Host header has priority over SERVER_NAME ');
}
public function testGetPort()
{
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'https',
'HTTP_X_FORWARDED_PORT' => '443',
- ));
+ ]);
$port = $request->getPort();
$this->assertEquals(80, $port, 'Without trusted proxies FORWARDED_PROTO and FORWARDED_PORT are ignored.');
- Request::setTrustedProxies(array('1.1.1.1'), Request::HEADER_X_FORWARDED_ALL);
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ Request::setTrustedProxies(['1.1.1.1'], Request::HEADER_X_FORWARDED_ALL);
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'https',
'HTTP_X_FORWARDED_PORT' => '8443',
- ));
+ ]);
$this->assertEquals(80, $request->getPort(), 'With PROTO and PORT on untrusted connection server value takes precedence.');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertEquals(8443, $request->getPort(), 'With PROTO and PORT set PORT takes precedence.');
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'https',
- ));
+ ]);
$this->assertEquals(80, $request->getPort(), 'With only PROTO set getPort() ignores trusted headers on untrusted connection.');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertEquals(443, $request->getPort(), 'With only PROTO set getPort() defaults to 443.');
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'http',
- ));
+ ]);
$this->assertEquals(80, $request->getPort(), 'If X_FORWARDED_PROTO is set to HTTP getPort() ignores trusted headers on untrusted connection.');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertEquals(80, $request->getPort(), 'If X_FORWARDED_PROTO is set to HTTP getPort() returns port of the original request.');
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'On',
- ));
+ ]);
$this->assertEquals(80, $request->getPort(), 'With only PROTO set and value is On, getPort() ignores trusted headers on untrusted connection.');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertEquals(443, $request->getPort(), 'With only PROTO set and value is On, getPort() defaults to 443.');
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => '1',
- ));
+ ]);
$this->assertEquals(80, $request->getPort(), 'With only PROTO set and value is 1, getPort() ignores trusted headers on untrusted connection.');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertEquals(443, $request->getPort(), 'With only PROTO set and value is 1, getPort() defaults to 443.');
- $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ $request = Request::create('http://example.com', 'GET', [], [], [], [
'HTTP_X_FORWARDED_PROTO' => 'something-else',
- ));
+ ]);
$port = $request->getPort();
$this->assertEquals(80, $port, 'With only PROTO set and value is not recognized, getPort() defaults to 80.');
}
@@ -898,7 +898,7 @@ class RequestTest extends TestCase
public function testGetHostWithFakeHttpHostValue()
{
$request = new Request();
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.host.com?query=string'));
+ $request->initialize([], [], [], [], [], ['HTTP_HOST' => 'www.host.com?query=string']);
$request->getHost();
}
@@ -958,7 +958,7 @@ class RequestTest extends TestCase
$request = new Request();
$request->setMethod('POST');
- $request->query->set('_method', array('delete', 'patch'));
+ $request->query->set('_method', ['delete', 'patch']);
$this->assertSame('POST', $request->getMethod(), '->getMethod() returns the request method if invalid type is defined in query');
}
@@ -995,69 +995,69 @@ class RequestTest extends TestCase
public function getClientIpsForwardedProvider()
{
// $expected $remoteAddr $httpForwarded $trustedProxies
- return array(
- array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', null),
- array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', array('127.0.0.1')),
- array(array('88.88.88.88'), '127.0.0.1', 'for="88.88.88.88:80"', array('127.0.0.1')),
- array(array('192.0.2.60'), '::1', 'for=192.0.2.60;proto=http;by=203.0.113.43', array('::1')),
- array(array('2620:0:1cfe:face:b00c::3', '192.0.2.43'), '::1', 'for=192.0.2.43, for="[2620:0:1cfe:face:b00c::3]"', array('::1')),
- array(array('2001:db8:cafe::17'), '::1', 'for="[2001:db8:cafe::17]:4711', array('::1')),
- );
+ return [
+ [['127.0.0.1'], '127.0.0.1', 'for="_gazonk"', null],
+ [['127.0.0.1'], '127.0.0.1', 'for="_gazonk"', ['127.0.0.1']],
+ [['88.88.88.88'], '127.0.0.1', 'for="88.88.88.88:80"', ['127.0.0.1']],
+ [['192.0.2.60'], '::1', 'for=192.0.2.60;proto=http;by=203.0.113.43', ['::1']],
+ [['2620:0:1cfe:face:b00c::3', '192.0.2.43'], '::1', 'for=192.0.2.43, for="[2620:0:1cfe:face:b00c::3]"', ['::1']],
+ [['2001:db8:cafe::17'], '::1', 'for="[2001:db8:cafe::17]:4711', ['::1']],
+ ];
}
public function getClientIpsProvider()
{
// $expected $remoteAddr $httpForwardedFor $trustedProxies
- return array(
+ return [
// simple IPv4
- array(array('88.88.88.88'), '88.88.88.88', null, null),
+ [['88.88.88.88'], '88.88.88.88', null, null],
// trust the IPv4 remote addr
- array(array('88.88.88.88'), '88.88.88.88', null, array('88.88.88.88')),
+ [['88.88.88.88'], '88.88.88.88', null, ['88.88.88.88']],
// simple IPv6
- array(array('::1'), '::1', null, null),
+ [['::1'], '::1', null, null],
// trust the IPv6 remote addr
- array(array('::1'), '::1', null, array('::1')),
+ [['::1'], '::1', null, ['::1']],
// forwarded for with remote IPv4 addr not trusted
- array(array('127.0.0.1'), '127.0.0.1', '88.88.88.88', null),
+ [['127.0.0.1'], '127.0.0.1', '88.88.88.88', null],
// forwarded for with remote IPv4 addr trusted + comma
- array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88,', array('127.0.0.1')),
+ [['88.88.88.88'], '127.0.0.1', '88.88.88.88,', ['127.0.0.1']],
// forwarded for with remote IPv4 and all FF addrs trusted
- array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1', '88.88.88.88')),
+ [['88.88.88.88'], '127.0.0.1', '88.88.88.88', ['127.0.0.1', '88.88.88.88']],
// forwarded for with remote IPv4 range trusted
- array(array('88.88.88.88'), '123.45.67.89', '88.88.88.88', array('123.45.67.0/24')),
+ [['88.88.88.88'], '123.45.67.89', '88.88.88.88', ['123.45.67.0/24']],
// forwarded for with remote IPv6 addr not trusted
- array(array('1620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null),
+ [['1620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null],
// forwarded for with remote IPv6 addr trusted
- array(array('2620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')),
+ [['2620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3']],
// forwarded for with remote IPv6 range trusted
- array(array('88.88.88.88'), '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', array('2a01:198:603:0::/65')),
+ [['88.88.88.88'], '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', ['2a01:198:603:0::/65']],
// multiple forwarded for with remote IPv4 addr trusted
- array(array('88.88.88.88', '87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89')),
+ [['88.88.88.88', '87.65.43.21', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89']],
// multiple forwarded for with remote IPv4 addr and some reverse proxies trusted
- array(array('87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '88.88.88.88')),
+ [['87.65.43.21', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '88.88.88.88']],
// multiple forwarded for with remote IPv4 addr and some reverse proxies trusted but in the middle
- array(array('88.88.88.88', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21')),
+ [['88.88.88.88', '127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '87.65.43.21']],
// multiple forwarded for with remote IPv4 addr and all reverse proxies trusted
- array(array('127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21', '88.88.88.88', '127.0.0.1')),
+ [['127.0.0.1'], '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', ['123.45.67.89', '87.65.43.21', '88.88.88.88', '127.0.0.1']],
// multiple forwarded for with remote IPv6 addr trusted
- array(array('2620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')),
+ [['2620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3']],
// multiple forwarded for with remote IPv6 addr and some reverse proxies trusted
- array(array('3620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3')),
+ [['3620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3']],
// multiple forwarded for with remote IPv4 addr and some reverse proxies trusted but in the middle
- array(array('2620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3,3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3')),
+ [['2620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '4620:0:1cfe:face:b00c::3,3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3']],
// client IP with port
- array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88:12345, 127.0.0.1', array('127.0.0.1')),
+ [['88.88.88.88'], '127.0.0.1', '88.88.88.88:12345, 127.0.0.1', ['127.0.0.1']],
// invalid forwarded IP is ignored
- array(array('88.88.88.88'), '127.0.0.1', 'unknown,88.88.88.88', array('127.0.0.1')),
- array(array('88.88.88.88'), '127.0.0.1', '}__test|O:21:&quot;JDatabaseDriverMysqli&quot;:3:{s:2,88.88.88.88', array('127.0.0.1')),
- );
+ [['88.88.88.88'], '127.0.0.1', 'unknown,88.88.88.88', ['127.0.0.1']],
+ [['88.88.88.88'], '127.0.0.1', '}__test|O:21:&quot;JDatabaseDriverMysqli&quot;:3:{s:2,88.88.88.88', ['127.0.0.1']],
+ ];
}
/**
@@ -1068,15 +1068,15 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array(
+ $server = [
'REMOTE_ADDR' => '88.88.88.88',
'HTTP_FORWARDED' => $httpForwarded,
'HTTP_X_FORWARDED_FOR' => $httpXForwardedFor,
- );
+ ];
- Request::setTrustedProxies(array('88.88.88.88'), Request::HEADER_X_FORWARDED_ALL | Request::HEADER_FORWARDED);
+ Request::setTrustedProxies(['88.88.88.88'], Request::HEADER_X_FORWARDED_ALL | Request::HEADER_FORWARDED);
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$request->getClientIps();
}
@@ -1088,15 +1088,15 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array(
+ $server = [
'REMOTE_ADDR' => '88.88.88.88',
'HTTP_FORWARDED' => $httpForwarded,
'HTTP_X_FORWARDED_FOR' => $httpXForwardedFor,
- );
+ ];
- Request::setTrustedProxies(array('88.88.88.88'), Request::HEADER_X_FORWARDED_FOR);
+ Request::setTrustedProxies(['88.88.88.88'], Request::HEADER_X_FORWARDED_FOR);
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertSame(array_reverse(explode(',', $httpXForwardedFor)), $request->getClientIps());
}
@@ -1104,13 +1104,13 @@ class RequestTest extends TestCase
public function getClientIpsWithConflictingHeadersProvider()
{
// $httpForwarded $httpXForwardedFor
- return array(
- array('for=87.65.43.21', '192.0.2.60'),
- array('for=87.65.43.21, for=192.0.2.60', '192.0.2.60'),
- array('for=192.0.2.60', '192.0.2.60,87.65.43.21'),
- array('for="::face", for=192.0.2.60', '192.0.2.60,192.0.2.43'),
- array('for=87.65.43.21, for=192.0.2.60', '192.0.2.60,87.65.43.21'),
- );
+ return [
+ ['for=87.65.43.21', '192.0.2.60'],
+ ['for=87.65.43.21, for=192.0.2.60', '192.0.2.60'],
+ ['for=192.0.2.60', '192.0.2.60,87.65.43.21'],
+ ['for="::face", for=192.0.2.60', '192.0.2.60,192.0.2.43'],
+ ['for=87.65.43.21, for=192.0.2.60', '192.0.2.60,87.65.43.21'],
+ ];
}
/**
@@ -1120,15 +1120,15 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array(
+ $server = [
'REMOTE_ADDR' => '88.88.88.88',
'HTTP_FORWARDED' => $httpForwarded,
'HTTP_X_FORWARDED_FOR' => $httpXForwardedFor,
- );
+ ];
- Request::setTrustedProxies(array('88.88.88.88'), -1);
+ Request::setTrustedProxies(['88.88.88.88'], -1);
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$clientIps = $request->getClientIps();
@@ -1138,14 +1138,14 @@ class RequestTest extends TestCase
public function getClientIpsWithAgreeingHeadersProvider()
{
// $httpForwarded $httpXForwardedFor
- return array(
- array('for="192.0.2.60"', '192.0.2.60', array('192.0.2.60')),
- array('for=192.0.2.60, for=87.65.43.21', '192.0.2.60,87.65.43.21', array('87.65.43.21', '192.0.2.60')),
- array('for="[::face]", for=192.0.2.60', '::face,192.0.2.60', array('192.0.2.60', '::face')),
- array('for="192.0.2.60:80"', '192.0.2.60', array('192.0.2.60')),
- array('for=192.0.2.60;proto=http;by=203.0.113.43', '192.0.2.60', array('192.0.2.60')),
- array('for="[2001:db8:cafe::17]:4711"', '2001:db8:cafe::17', array('2001:db8:cafe::17')),
- );
+ return [
+ ['for="192.0.2.60"', '192.0.2.60', ['192.0.2.60']],
+ ['for=192.0.2.60, for=87.65.43.21', '192.0.2.60,87.65.43.21', ['87.65.43.21', '192.0.2.60']],
+ ['for="[::face]", for=192.0.2.60', '::face,192.0.2.60', ['192.0.2.60', '::face']],
+ ['for="192.0.2.60:80"', '192.0.2.60', ['192.0.2.60']],
+ ['for=192.0.2.60;proto=http;by=203.0.113.43', '192.0.2.60', ['192.0.2.60']],
+ ['for="[2001:db8:cafe::17]:4711"', '2001:db8:cafe::17', ['2001:db8:cafe::17']],
+ ];
}
public function testGetContentWorksTwiceInDefaultMode()
@@ -1166,7 +1166,7 @@ class RequestTest extends TestCase
public function testGetContentReturnsResourceWhenContentSetInConstructor()
{
- $req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent');
+ $req = new Request([], [], [], [], [], [], 'MyContent');
$resource = $req->getContent(true);
$this->assertInternalType('resource', $resource);
@@ -1179,17 +1179,17 @@ class RequestTest extends TestCase
fwrite($resource, 'My other content');
rewind($resource);
- $req = new Request(array(), array(), array(), array(), array(), array(), $resource);
+ $req = new Request([], [], [], [], [], [], $resource);
$this->assertEquals('My other content', stream_get_contents($req->getContent(true)));
$this->assertEquals('My other content', $req->getContent());
}
public function getContentCantBeCalledTwiceWithResourcesProvider()
{
- return array(
- 'Resource then fetch' => array(true, false),
- 'Resource then resource' => array(true, true),
- );
+ return [
+ 'Resource then fetch' => [true, false],
+ 'Resource then resource' => [true, true],
+ ];
}
/**
@@ -1214,24 +1214,24 @@ class RequestTest extends TestCase
public function getContentCanBeCalledTwiceWithResourcesProvider()
{
- return array(
- 'Fetch then fetch' => array(false, false),
- 'Fetch then resource' => array(false, true),
- 'Resource then fetch' => array(true, false),
- 'Resource then resource' => array(true, true),
- );
+ return [
+ 'Fetch then fetch' => [false, false],
+ 'Fetch then resource' => [false, true],
+ 'Resource then fetch' => [true, false],
+ 'Resource then resource' => [true, true],
+ ];
}
public function provideOverloadedMethods()
{
- return array(
- array('PUT'),
- array('DELETE'),
- array('PATCH'),
- array('put'),
- array('delete'),
- array('patch'),
- );
+ return [
+ ['PUT'],
+ ['DELETE'],
+ ['PATCH'],
+ ['put'],
+ ['delete'],
+ ['patch'],
+ ];
}
/**
@@ -1244,14 +1244,14 @@ class RequestTest extends TestCase
$_GET['foo1'] = 'bar1';
$_POST['foo2'] = 'bar2';
$_COOKIE['foo3'] = 'bar3';
- $_FILES['foo4'] = array('bar4');
+ $_FILES['foo4'] = ['bar4'];
$_SERVER['foo5'] = 'bar5';
$request = Request::createFromGlobals();
$this->assertEquals('bar1', $request->query->get('foo1'), '::fromGlobals() uses values from $_GET');
$this->assertEquals('bar2', $request->request->get('foo2'), '::fromGlobals() uses values from $_POST');
$this->assertEquals('bar3', $request->cookies->get('foo3'), '::fromGlobals() uses values from $_COOKIE');
- $this->assertEquals(array('bar4'), $request->files->get('foo4'), '::fromGlobals() uses values from $_FILES');
+ $this->assertEquals(['bar4'], $request->files->get('foo4'), '::fromGlobals() uses values from $_FILES');
$this->assertEquals('bar5', $request->server->get('foo5'), '::fromGlobals() uses values from $_SERVER');
unset($_GET['foo1'], $_POST['foo2'], $_COOKIE['foo3'], $_FILES['foo4'], $_SERVER['foo5']);
@@ -1281,25 +1281,25 @@ class RequestTest extends TestCase
public function testOverrideGlobals()
{
$request = new Request();
- $request->initialize(array('foo' => 'bar'));
+ $request->initialize(['foo' => 'bar']);
// as the Request::overrideGlobals really work, it erase $_SERVER, so we must backup it
$server = $_SERVER;
$request->overrideGlobals();
- $this->assertEquals(array('foo' => 'bar'), $_GET);
+ $this->assertEquals(['foo' => 'bar'], $_GET);
- $request->initialize(array(), array('foo' => 'bar'));
+ $request->initialize([], ['foo' => 'bar']);
$request->overrideGlobals();
- $this->assertEquals(array('foo' => 'bar'), $_POST);
+ $this->assertEquals(['foo' => 'bar'], $_POST);
$this->assertArrayNotHasKey('HTTP_X_FORWARDED_PROTO', $_SERVER);
$request->headers->set('X_FORWARDED_PROTO', 'https');
- Request::setTrustedProxies(array('1.1.1.1'), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies(['1.1.1.1'], Request::HEADER_X_FORWARDED_ALL);
$this->assertFalse($request->isSecure());
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$this->assertTrue($request->isSecure());
@@ -1316,12 +1316,12 @@ class RequestTest extends TestCase
$this->assertArrayHasKey('CONTENT_TYPE', $_SERVER);
$this->assertArrayHasKey('CONTENT_LENGTH', $_SERVER);
- $request->initialize(array('foo' => 'bar', 'baz' => 'foo'));
+ $request->initialize(['foo' => 'bar', 'baz' => 'foo']);
$request->query->remove('baz');
$request->overrideGlobals();
- $this->assertEquals(array('foo' => 'bar'), $_GET);
+ $this->assertEquals(['foo' => 'bar'], $_GET);
$this->assertEquals('foo=bar', $_SERVER['QUERY_STRING']);
$this->assertEquals('foo=bar', $request->server->get('QUERY_STRING'));
@@ -1334,23 +1334,23 @@ class RequestTest extends TestCase
$request = new Request();
$this->assertEquals('', $request->getScriptName());
- $server = array();
+ $server = [];
$server['SCRIPT_NAME'] = '/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/index.php', $request->getScriptName());
- $server = array();
+ $server = [];
$server['ORIG_SCRIPT_NAME'] = '/frontend.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/frontend.php', $request->getScriptName());
- $server = array();
+ $server = [];
$server['SCRIPT_NAME'] = '/index.php';
$server['ORIG_SCRIPT_NAME'] = '/frontend.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/index.php', $request->getScriptName());
}
@@ -1360,29 +1360,29 @@ class RequestTest extends TestCase
$request = new Request();
$this->assertEquals('', $request->getBasePath());
- $server = array();
+ $server = [];
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('', $request->getBasePath());
- $server = array();
+ $server = [];
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
$server['SCRIPT_NAME'] = '/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('', $request->getBasePath());
- $server = array();
+ $server = [];
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
$server['PHP_SELF'] = '/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('', $request->getBasePath());
- $server = array();
+ $server = [];
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
$server['ORIG_SCRIPT_NAME'] = '/index.php';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('', $request->getBasePath());
}
@@ -1392,21 +1392,21 @@ class RequestTest extends TestCase
$request = new Request();
$this->assertEquals('/', $request->getPathInfo());
- $server = array();
+ $server = [];
$server['REQUEST_URI'] = '/path/info';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/path/info', $request->getPathInfo());
- $server = array();
+ $server = [];
$server['REQUEST_URI'] = '/path%20test/info';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/path%20test/info', $request->getPathInfo());
- $server = array();
+ $server = [];
$server['REQUEST_URI'] = '?a=b';
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
$this->assertEquals('/', $request->getPathInfo());
}
@@ -1434,27 +1434,27 @@ class RequestTest extends TestCase
{
$request = new Request();
$this->assertNull($request->getPreferredLanguage());
- $this->assertNull($request->getPreferredLanguage(array()));
- $this->assertEquals('fr', $request->getPreferredLanguage(array('fr')));
- $this->assertEquals('fr', $request->getPreferredLanguage(array('fr', 'en')));
- $this->assertEquals('en', $request->getPreferredLanguage(array('en', 'fr')));
- $this->assertEquals('fr-ch', $request->getPreferredLanguage(array('fr-ch', 'fr-fr')));
+ $this->assertNull($request->getPreferredLanguage([]));
+ $this->assertEquals('fr', $request->getPreferredLanguage(['fr']));
+ $this->assertEquals('fr', $request->getPreferredLanguage(['fr', 'en']));
+ $this->assertEquals('en', $request->getPreferredLanguage(['en', 'fr']));
+ $this->assertEquals('fr-ch', $request->getPreferredLanguage(['fr-ch', 'fr-fr']));
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
- $this->assertEquals('en', $request->getPreferredLanguage(array('en', 'en-us')));
+ $this->assertEquals('en', $request->getPreferredLanguage(['en', 'en-us']));
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
- $this->assertEquals('en', $request->getPreferredLanguage(array('fr', 'en')));
+ $this->assertEquals('en', $request->getPreferredLanguage(['fr', 'en']));
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8');
- $this->assertEquals('en', $request->getPreferredLanguage(array('fr', 'en')));
+ $this->assertEquals('en', $request->getPreferredLanguage(['fr', 'en']));
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, fr-fr; q=0.6, fr; q=0.5');
- $this->assertEquals('en', $request->getPreferredLanguage(array('fr', 'en')));
+ $this->assertEquals('en', $request->getPreferredLanguage(['fr', 'en']));
}
public function testIsXmlHttpRequest()
@@ -1492,72 +1492,72 @@ class RequestTest extends TestCase
public function testGetCharsets()
{
$request = new Request();
- $this->assertEquals(array(), $request->getCharsets());
+ $this->assertEquals([], $request->getCharsets());
$request->headers->set('Accept-Charset', 'ISO-8859-1, US-ASCII, UTF-8; q=0.8, ISO-10646-UCS-2; q=0.6');
- $this->assertEquals(array(), $request->getCharsets()); // testing caching
+ $this->assertEquals([], $request->getCharsets()); // testing caching
$request = new Request();
$request->headers->set('Accept-Charset', 'ISO-8859-1, US-ASCII, UTF-8; q=0.8, ISO-10646-UCS-2; q=0.6');
- $this->assertEquals(array('ISO-8859-1', 'US-ASCII', 'UTF-8', 'ISO-10646-UCS-2'), $request->getCharsets());
+ $this->assertEquals(['ISO-8859-1', 'US-ASCII', 'UTF-8', 'ISO-10646-UCS-2'], $request->getCharsets());
$request = new Request();
$request->headers->set('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7');
- $this->assertEquals(array('ISO-8859-1', 'utf-8', '*'), $request->getCharsets());
+ $this->assertEquals(['ISO-8859-1', 'utf-8', '*'], $request->getCharsets());
}
public function testGetEncodings()
{
$request = new Request();
- $this->assertEquals(array(), $request->getEncodings());
+ $this->assertEquals([], $request->getEncodings());
$request->headers->set('Accept-Encoding', 'gzip,deflate,sdch');
- $this->assertEquals(array(), $request->getEncodings()); // testing caching
+ $this->assertEquals([], $request->getEncodings()); // testing caching
$request = new Request();
$request->headers->set('Accept-Encoding', 'gzip,deflate,sdch');
- $this->assertEquals(array('gzip', 'deflate', 'sdch'), $request->getEncodings());
+ $this->assertEquals(['gzip', 'deflate', 'sdch'], $request->getEncodings());
$request = new Request();
$request->headers->set('Accept-Encoding', 'gzip;q=0.4,deflate;q=0.9,compress;q=0.7');
- $this->assertEquals(array('deflate', 'compress', 'gzip'), $request->getEncodings());
+ $this->assertEquals(['deflate', 'compress', 'gzip'], $request->getEncodings());
}
public function testGetAcceptableContentTypes()
{
$request = new Request();
- $this->assertEquals(array(), $request->getAcceptableContentTypes());
+ $this->assertEquals([], $request->getAcceptableContentTypes());
$request->headers->set('Accept', 'application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*');
- $this->assertEquals(array(), $request->getAcceptableContentTypes()); // testing caching
+ $this->assertEquals([], $request->getAcceptableContentTypes()); // testing caching
$request = new Request();
$request->headers->set('Accept', 'application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*');
- $this->assertEquals(array('application/vnd.wap.wmlscriptc', 'text/vnd.wap.wml', 'application/vnd.wap.xhtml+xml', 'application/xhtml+xml', 'text/html', 'multipart/mixed', '*/*'), $request->getAcceptableContentTypes());
+ $this->assertEquals(['application/vnd.wap.wmlscriptc', 'text/vnd.wap.wml', 'application/vnd.wap.xhtml+xml', 'application/xhtml+xml', 'text/html', 'multipart/mixed', '*/*'], $request->getAcceptableContentTypes());
}
public function testGetLanguages()
{
$request = new Request();
- $this->assertEquals(array(), $request->getLanguages());
+ $this->assertEquals([], $request->getLanguages());
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
- $this->assertEquals(array('zh', 'en_US', 'en'), $request->getLanguages());
- $this->assertEquals(array('zh', 'en_US', 'en'), $request->getLanguages());
+ $this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
+ $this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.6, en; q=0.8');
- $this->assertEquals(array('zh', 'en', 'en_US'), $request->getLanguages()); // Test out of order qvalues
+ $this->assertEquals(['zh', 'en', 'en_US'], $request->getLanguages()); // Test out of order qvalues
$request = new Request();
$request->headers->set('Accept-language', 'zh, en, en-us');
- $this->assertEquals(array('zh', 'en', 'en_US'), $request->getLanguages()); // Test equal weighting without qvalues
+ $this->assertEquals(['zh', 'en', 'en_US'], $request->getLanguages()); // Test equal weighting without qvalues
$request = new Request();
$request->headers->set('Accept-language', 'zh; q=0.6, en, en-us; q=0.6');
- $this->assertEquals(array('en', 'zh', 'en_US'), $request->getLanguages()); // Test equal weighting with qvalues
+ $this->assertEquals(['en', 'zh', 'en_US'], $request->getLanguages()); // Test equal weighting with qvalues
$request = new Request();
$request->headers->set('Accept-language', 'zh, i-cherokee; q=0.6');
- $this->assertEquals(array('zh', 'cherokee'), $request->getLanguages());
+ $this->assertEquals(['zh', 'cherokee'], $request->getLanguages());
}
public function testGetRequestFormat()
@@ -1577,7 +1577,7 @@ class RequestTest extends TestCase
$this->assertNull($request->setRequestFormat('foo'));
$this->assertEquals('foo', $request->getRequestFormat(null));
- $request = new Request(array('_format' => 'foo'));
+ $request = new Request(['_format' => 'foo']);
$this->assertEquals('html', $request->getRequestFormat());
}
@@ -1663,7 +1663,7 @@ class RequestTest extends TestCase
*/
public function testGetBaseUrl($uri, $server, $expectedBaseUrl, $expectedPathInfo)
{
- $request = Request::create($uri, 'GET', array(), array(), array(), $server);
+ $request = Request::create($uri, 'GET', [], [], [], $server);
$this->assertSame($expectedBaseUrl, $request->getBaseUrl(), 'baseUrl');
$this->assertSame($expectedPathInfo, $request->getPathInfo(), 'pathInfo');
@@ -1671,78 +1671,78 @@ class RequestTest extends TestCase
public function getBaseUrlData()
{
- return array(
- array(
+ return [
+ [
'/fruit/strawberry/1234index.php/blah',
- array(
+ [
'SCRIPT_FILENAME' => 'E:/Sites/cc-new/public_html/fruit/index.php',
'SCRIPT_NAME' => '/fruit/index.php',
'PHP_SELF' => '/fruit/index.php',
- ),
+ ],
'/fruit',
'/strawberry/1234index.php/blah',
- ),
- array(
+ ],
+ [
'/fruit/strawberry/1234index.php/blah',
- array(
+ [
'SCRIPT_FILENAME' => 'E:/Sites/cc-new/public_html/index.php',
'SCRIPT_NAME' => '/index.php',
'PHP_SELF' => '/index.php',
- ),
+ ],
'',
'/fruit/strawberry/1234index.php/blah',
- ),
- array(
+ ],
+ [
'/foo%20bar/',
- array(
+ [
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo bar/app.php',
'SCRIPT_NAME' => '/foo bar/app.php',
'PHP_SELF' => '/foo bar/app.php',
- ),
+ ],
'/foo%20bar',
'/',
- ),
- array(
+ ],
+ [
'/foo%20bar/home',
- array(
+ [
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo bar/app.php',
'SCRIPT_NAME' => '/foo bar/app.php',
'PHP_SELF' => '/foo bar/app.php',
- ),
+ ],
'/foo%20bar',
'/home',
- ),
- array(
+ ],
+ [
'/foo%20bar/app.php/home',
- array(
+ [
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo bar/app.php',
'SCRIPT_NAME' => '/foo bar/app.php',
'PHP_SELF' => '/foo bar/app.php',
- ),
+ ],
'/foo%20bar/app.php',
'/home',
- ),
- array(
+ ],
+ [
'/foo%20bar/app.php/home%3Dbaz',
- array(
+ [
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo bar/app.php',
'SCRIPT_NAME' => '/foo bar/app.php',
'PHP_SELF' => '/foo bar/app.php',
- ),
+ ],
'/foo%20bar/app.php',
'/home%3Dbaz',
- ),
- array(
+ ],
+ [
'/foo/bar+baz',
- array(
+ [
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app.php',
'SCRIPT_NAME' => '/foo/app.php',
'PHP_SELF' => '/foo/app.php',
- ),
+ ],
'/foo',
'/bar+baz',
- ),
- );
+ ],
+ ];
}
/**
@@ -1760,16 +1760,16 @@ class RequestTest extends TestCase
public function urlencodedStringPrefixData()
{
- return array(
- array('foo', 'foo', 'foo'),
- array('fo%6f', 'foo', 'fo%6f'),
- array('foo/bar', 'foo', 'foo'),
- array('fo%6f/bar', 'foo', 'fo%6f'),
- array('f%6f%6f/bar', 'foo', 'f%6f%6f'),
- array('%66%6F%6F/bar', 'foo', '%66%6F%6F'),
- array('fo+o/bar', 'fo+o', 'fo+o'),
- array('fo%2Bo/bar', 'fo+o', 'fo%2Bo'),
- );
+ return [
+ ['foo', 'foo', 'foo'],
+ ['fo%6f', 'foo', 'fo%6f'],
+ ['foo/bar', 'foo', 'foo'],
+ ['fo%6f/bar', 'foo', 'fo%6f'],
+ ['f%6f%6f/bar', 'foo', 'f%6f%6f'],
+ ['%66%6F%6F/bar', 'foo', '%66%6F%6F'],
+ ['fo+o/bar', 'fo+o', 'fo+o'],
+ ['fo%2Bo/bar', 'fo+o', 'fo%2Bo'],
+ ];
}
private function disableHttpMethodParameterOverride()
@@ -1784,7 +1784,7 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array('REMOTE_ADDR' => $remoteAddr);
+ $server = ['REMOTE_ADDR' => $remoteAddr];
if (null !== $httpForwardedFor) {
$server['HTTP_X_FORWARDED_FOR'] = $httpForwardedFor;
}
@@ -1793,7 +1793,7 @@ class RequestTest extends TestCase
Request::setTrustedProxies($trustedProxies, Request::HEADER_X_FORWARDED_ALL);
}
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
return $request;
}
@@ -1802,7 +1802,7 @@ class RequestTest extends TestCase
{
$request = new Request();
- $server = array('REMOTE_ADDR' => $remoteAddr);
+ $server = ['REMOTE_ADDR' => $remoteAddr];
if (null !== $httpForwarded) {
$server['HTTP_FORWARDED'] = $httpForwarded;
@@ -1812,7 +1812,7 @@ class RequestTest extends TestCase
Request::setTrustedProxies($trustedProxies, Request::HEADER_FORWARDED);
}
- $request->initialize(array(), array(), array(), array(), array(), $server);
+ $request->initialize([], [], [], [], [], $server);
return $request;
}
@@ -1833,35 +1833,35 @@ class RequestTest extends TestCase
$this->assertFalse($request->isSecure());
// disabling proxy trusting
- Request::setTrustedProxies(array(), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// request is forwarded by a non-trusted proxy
- Request::setTrustedProxies(array('2.2.2.2'), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies(['2.2.2.2'], Request::HEADER_X_FORWARDED_ALL);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// trusted proxy via setTrustedProxies()
- Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies(['3.3.3.3', '2.2.2.2'], Request::HEADER_X_FORWARDED_ALL);
$this->assertEquals('1.1.1.1', $request->getClientIp());
$this->assertEquals('foo.example.com', $request->getHost());
$this->assertEquals(443, $request->getPort());
$this->assertTrue($request->isSecure());
// trusted proxy via setTrustedProxies()
- Request::setTrustedProxies(array('3.3.3.4', '2.2.2.2'), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies(['3.3.3.4', '2.2.2.2'], Request::HEADER_X_FORWARDED_ALL);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// check various X_FORWARDED_PROTO header values
- Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'), Request::HEADER_X_FORWARDED_ALL);
+ Request::setTrustedProxies(['3.3.3.3', '2.2.2.2'], Request::HEADER_X_FORWARDED_ALL);
$request->headers->set('X_FORWARDED_PROTO', 'ssl');
$this->assertTrue($request->isSecure());
@@ -1882,35 +1882,35 @@ class RequestTest extends TestCase
$this->assertFalse($request->isSecure());
// disabling proxy trusting
- Request::setTrustedProxies(array(), Request::HEADER_FORWARDED);
+ Request::setTrustedProxies([], Request::HEADER_FORWARDED);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// request is forwarded by a non-trusted proxy
- Request::setTrustedProxies(array('2.2.2.2'), Request::HEADER_FORWARDED);
+ Request::setTrustedProxies(['2.2.2.2'], Request::HEADER_FORWARDED);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// trusted proxy via setTrustedProxies()
- Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'), Request::HEADER_FORWARDED);
+ Request::setTrustedProxies(['3.3.3.3', '2.2.2.2'], Request::HEADER_FORWARDED);
$this->assertEquals('1.1.1.1', $request->getClientIp());
$this->assertEquals('foo.example.com', $request->getHost());
$this->assertEquals(8080, $request->getPort());
$this->assertTrue($request->isSecure());
// trusted proxy via setTrustedProxies()
- Request::setTrustedProxies(array('3.3.3.4', '2.2.2.2'), Request::HEADER_FORWARDED);
+ Request::setTrustedProxies(['3.3.3.4', '2.2.2.2'], Request::HEADER_FORWARDED);
$this->assertEquals('3.3.3.3', $request->getClientIp());
$this->assertEquals('example.com', $request->getHost());
$this->assertEquals(80, $request->getPort());
$this->assertFalse($request->isSecure());
// check various X_FORWARDED_PROTO header values
- Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'), Request::HEADER_FORWARDED);
+ Request::setTrustedProxies(['3.3.3.3', '2.2.2.2'], Request::HEADER_FORWARDED);
$request->headers->set('FORWARDED', 'proto=ssl');
$this->assertTrue($request->isSecure());
@@ -1930,37 +1930,37 @@ class RequestTest extends TestCase
$this->assertEquals($expectedRequestUri, $request->getRequestUri(), '->getRequestUri() is correct');
$subRequestUri = '/bar/foo';
- $subRequest = Request::create($subRequestUri, 'get', array(), array(), array(), $request->server->all());
+ $subRequest = Request::create($subRequestUri, 'get', [], [], [], $request->server->all());
$this->assertEquals($subRequestUri, $subRequest->getRequestUri(), '->getRequestUri() is correct in sub request');
}
public function iisRequestUriProvider()
{
- return array(
- array(
- array(),
- array(
+ return [
+ [
+ [],
+ [
'IIS_WasUrlRewritten' => '1',
'UNENCODED_URL' => '/foo/bar',
- ),
+ ],
'/foo/bar',
- ),
- array(
- array(),
- array(
+ ],
+ [
+ [],
+ [
'ORIG_PATH_INFO' => '/foo/bar',
- ),
+ ],
'/foo/bar',
- ),
- array(
- array(),
- array(
+ ],
+ [
+ [],
+ [
'ORIG_PATH_INFO' => '/foo/bar',
'QUERY_STRING' => 'foo=bar',
- ),
+ ],
'/foo/bar?foo=bar',
- ),
- );
+ ],
+ ];
}
public function testTrustedHosts()
@@ -1973,7 +1973,7 @@ class RequestTest extends TestCase
$this->assertEquals('evil.com', $request->getHost());
// add a trusted domain and all its subdomains
- Request::setTrustedHosts(array('^([a-z]{9}\.)?trusted\.com$'));
+ Request::setTrustedHosts(['^([a-z]{9}\.)?trusted\.com$']);
// untrusted host
$request->headers->set('host', 'evil.com');
@@ -2005,7 +2005,7 @@ class RequestTest extends TestCase
public function testSetTrustedHostsDoesNotBreakOnSpecialCharacters()
{
- Request::setTrustedHosts(array('localhost(\.local){0,1}#,example.com', 'localhost'));
+ Request::setTrustedHosts(['localhost(\.local){0,1}#,example.com', 'localhost']);
$request = Request::create('/');
$request->headers->set('host', 'localhost');
@@ -2014,7 +2014,7 @@ class RequestTest extends TestCase
public function testFactory()
{
- Request::setFactory(function (array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) {
+ Request::setFactory(function (array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) {
return new NewRequest();
});
@@ -2063,23 +2063,23 @@ class RequestTest extends TestCase
public function getHostValidities()
{
- return array(
- array('.a', false),
- array('a..', false),
- array('a.', true),
- array("\xE9", false),
- array('[::1]', true),
- array('[::1]:80', true, '[::1]', 80),
- array(str_repeat('.', 101), false),
- );
+ return [
+ ['.a', false],
+ ['a..', false],
+ ['a.', true],
+ ["\xE9", false],
+ ['[::1]', true],
+ ['[::1]:80', true, '[::1]', 80],
+ [str_repeat('.', 101), false],
+ ];
}
public function getLongHostNames()
{
- return array(
- array('a'.str_repeat('.a', 40000)),
- array(str_repeat(':', 101)),
- );
+ return [
+ ['a'.str_repeat('.a', 40000)],
+ [str_repeat(':', 101)],
+ ];
}
/**
@@ -2094,18 +2094,18 @@ class RequestTest extends TestCase
public function methodIdempotentProvider()
{
- return array(
- array('HEAD', true),
- array('GET', true),
- array('POST', false),
- array('PUT', true),
- array('PATCH', false),
- array('DELETE', true),
- array('PURGE', true),
- array('OPTIONS', true),
- array('TRACE', true),
- array('CONNECT', false),
- );
+ return [
+ ['HEAD', true],
+ ['GET', true],
+ ['POST', false],
+ ['PUT', true],
+ ['PATCH', false],
+ ['DELETE', true],
+ ['PURGE', true],
+ ['OPTIONS', true],
+ ['TRACE', true],
+ ['CONNECT', false],
+ ];
}
/**
@@ -2120,18 +2120,18 @@ class RequestTest extends TestCase
public function methodSafeProvider()
{
- return array(
- array('HEAD', true),
- array('GET', true),
- array('POST', false),
- array('PUT', false),
- array('PATCH', false),
- array('DELETE', false),
- array('PURGE', false),
- array('OPTIONS', true),
- array('TRACE', true),
- array('CONNECT', false),
- );
+ return [
+ ['HEAD', true],
+ ['GET', true],
+ ['POST', false],
+ ['PUT', false],
+ ['PATCH', false],
+ ['DELETE', false],
+ ['PURGE', false],
+ ['OPTIONS', true],
+ ['TRACE', true],
+ ['CONNECT', false],
+ ];
}
/**
@@ -2156,18 +2156,18 @@ class RequestTest extends TestCase
public function methodCacheableProvider()
{
- return array(
- array('HEAD', true),
- array('GET', true),
- array('POST', false),
- array('PUT', false),
- array('PATCH', false),
- array('DELETE', false),
- array('PURGE', false),
- array('OPTIONS', false),
- array('TRACE', false),
- array('CONNECT', false),
- );
+ return [
+ ['HEAD', true],
+ ['GET', true],
+ ['POST', false],
+ ['PUT', false],
+ ['PATCH', false],
+ ['DELETE', false],
+ ['PURGE', false],
+ ['OPTIONS', false],
+ ['TRACE', false],
+ ['CONNECT', false],
+ ];
}
/**
@@ -2176,7 +2176,7 @@ class RequestTest extends TestCase
public function testProtocolVersion($serverProtocol, $trustedProxy, $via, $expected)
{
if ($trustedProxy) {
- Request::setTrustedProxies(array('1.1.1.1'), -1);
+ Request::setTrustedProxies(['1.1.1.1'], -1);
}
$request = new Request();
@@ -2189,41 +2189,41 @@ class RequestTest extends TestCase
public function protocolVersionProvider()
{
- return array(
- 'untrusted without via' => array('HTTP/2.0', false, '', 'HTTP/2.0'),
- 'untrusted with via' => array('HTTP/2.0', false, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/2.0'),
- 'trusted without via' => array('HTTP/2.0', true, '', 'HTTP/2.0'),
- 'trusted with via' => array('HTTP/2.0', true, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'),
- 'trusted with via and protocol name' => array('HTTP/2.0', true, 'HTTP/1.0 fred, HTTP/1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'),
- 'trusted with broken via' => array('HTTP/2.0', true, 'HTTP/1^0 foo', 'HTTP/2.0'),
- 'trusted with partially-broken via' => array('HTTP/2.0', true, '1.0 fred, foo', 'HTTP/1.0'),
- );
+ return [
+ 'untrusted without via' => ['HTTP/2.0', false, '', 'HTTP/2.0'],
+ 'untrusted with via' => ['HTTP/2.0', false, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/2.0'],
+ 'trusted without via' => ['HTTP/2.0', true, '', 'HTTP/2.0'],
+ 'trusted with via' => ['HTTP/2.0', true, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'],
+ 'trusted with via and protocol name' => ['HTTP/2.0', true, 'HTTP/1.0 fred, HTTP/1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'],
+ 'trusted with broken via' => ['HTTP/2.0', true, 'HTTP/1^0 foo', 'HTTP/2.0'],
+ 'trusted with partially-broken via' => ['HTTP/2.0', true, '1.0 fred, foo', 'HTTP/1.0'],
+ ];
}
public function nonstandardRequestsData()
{
- return array(
- array('', '', '/', 'http://host:8080/', ''),
- array('/', '', '/', 'http://host:8080/', ''),
+ return [
+ ['', '', '/', 'http://host:8080/', ''],
+ ['/', '', '/', 'http://host:8080/', ''],
- array('hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'),
- array('/hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'),
+ ['hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'],
+ ['/hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'],
- array('', 'a=b', '/', 'http://host:8080/?a=b'),
- array('?a=b', 'a=b', '/', 'http://host:8080/?a=b'),
- array('/?a=b', 'a=b', '/', 'http://host:8080/?a=b'),
+ ['', 'a=b', '/', 'http://host:8080/?a=b'],
+ ['?a=b', 'a=b', '/', 'http://host:8080/?a=b'],
+ ['/?a=b', 'a=b', '/', 'http://host:8080/?a=b'],
- array('x', 'a=b', '/x', 'http://host:8080/x?a=b'),
- array('x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'),
- array('/x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'),
+ ['x', 'a=b', '/x', 'http://host:8080/x?a=b'],
+ ['x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'],
+ ['/x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'],
- array('hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'),
- array('/hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'),
+ ['hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'],
+ ['/hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'],
- array('hello/app.php/x', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'),
- array('hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'),
- array('/hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'),
- );
+ ['hello/app.php/x', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'],
+ ['hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'],
+ ['/hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'],
+ ];
}
/**
@@ -2235,16 +2235,16 @@ class RequestTest extends TestCase
$expectedBaseUrl = $expectedBasePath;
}
- $server = array(
+ $server = [
'HTTP_HOST' => 'host:8080',
'SERVER_PORT' => '8080',
'QUERY_STRING' => $queryString,
'PHP_SELF' => '/hello/app.php',
'SCRIPT_FILENAME' => '/some/path/app.php',
'REQUEST_URI' => $requestUri,
- );
+ ];
- $request = new Request(array(), array(), array(), array(), array(), $server);
+ $request = new Request([], [], [], [], [], $server);
$this->assertEquals($expectedPathInfo, $request->getPathInfo());
$this->assertEquals($expectedUri, $request->getUri());
@@ -2257,7 +2257,7 @@ class RequestTest extends TestCase
public function testTrustedHost()
{
- Request::setTrustedProxies(array('1.1.1.1'), -1);
+ Request::setTrustedProxies(['1.1.1.1'], -1);
$request = Request::create('/');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
@@ -2279,7 +2279,7 @@ class RequestTest extends TestCase
public function testTrustedPort()
{
- Request::setTrustedProxies(array('1.1.1.1'), -1);
+ Request::setTrustedProxies(['1.1.1.1'], -1);
$request = Request::create('/');
$request->server->set('REMOTE_ADDR', '1.1.1.1');
@@ -2309,7 +2309,7 @@ class RequestContentProxy extends Request
{
public function getContent($asResource = false)
{
- return http_build_query(array('_method' => 'PUT', 'content' => 'mycontent'), '', '&');
+ return http_build_query(['_method' => 'PUT', 'content' => 'mycontent'], '', '&');
}
}
diff --git a/vendor/symfony/http-foundation/Tests/ResponseFunctionalTest.php b/vendor/symfony/http-foundation/Tests/ResponseFunctionalTest.php
index 22f25e978e..3d3e696c75 100644
--- a/vendor/symfony/http-foundation/Tests/ResponseFunctionalTest.php
+++ b/vendor/symfony/http-foundation/Tests/ResponseFunctionalTest.php
@@ -22,10 +22,10 @@ class ResponseFunctionalTest extends TestCase
public static function setUpBeforeClass()
{
- $spec = array(
- 1 => array('file', '/dev/null', 'w'),
- 2 => array('file', '/dev/null', 'w'),
- );
+ $spec = [
+ 1 => ['file', '/dev/null', 'w'],
+ 2 => ['file', '/dev/null', 'w'],
+ ];
if (!self::$server = @proc_open('exec php -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) {
self::markTestSkipped('PHP server unable to start.');
}
@@ -52,7 +52,7 @@ class ResponseFunctionalTest extends TestCase
public function provideCookie()
{
foreach (glob(__DIR__.'/Fixtures/response-functional/*.php') as $file) {
- yield array(pathinfo($file, PATHINFO_FILENAME));
+ yield [pathinfo($file, PATHINFO_FILENAME)];
}
}
}
diff --git a/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php b/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
index f6ddb98ea7..35df36c1c6 100644
--- a/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
@@ -22,7 +22,7 @@ class ResponseHeaderBagTest extends TestCase
{
public function testAllPreserveCase()
{
- $headers = array(
+ $headers = [
'fOo' => 'BAR',
'ETag' => 'xyzzy',
'Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ==',
@@ -30,7 +30,7 @@ class ResponseHeaderBagTest extends TestCase
'WWW-Authenticate' => 'Basic realm="WallyWorld"',
'X-UA-Compatible' => 'IE=edge,chrome=1',
'X-XSS-Protection' => '1; mode=block',
- );
+ ];
$bag = new ResponseHeaderBag($headers);
$allPreservedCase = $bag->allPreserveCase();
@@ -42,45 +42,45 @@ class ResponseHeaderBagTest extends TestCase
public function testCacheControlHeader()
{
- $bag = new ResponseHeaderBag(array());
+ $bag = new ResponseHeaderBag([]);
$this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
- $bag = new ResponseHeaderBag(array('Cache-Control' => 'public'));
+ $bag = new ResponseHeaderBag(['Cache-Control' => 'public']);
$this->assertEquals('public', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('public'));
- $bag = new ResponseHeaderBag(array('ETag' => 'abcde'));
+ $bag = new ResponseHeaderBag(['ETag' => 'abcde']);
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('private'));
$this->assertTrue($bag->hasCacheControlDirective('must-revalidate'));
$this->assertFalse($bag->hasCacheControlDirective('max-age'));
- $bag = new ResponseHeaderBag(array('Expires' => 'Wed, 16 Feb 2011 14:17:43 GMT'));
+ $bag = new ResponseHeaderBag(['Expires' => 'Wed, 16 Feb 2011 14:17:43 GMT']);
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array(
+ $bag = new ResponseHeaderBag([
'Expires' => 'Wed, 16 Feb 2011 14:17:43 GMT',
'Cache-Control' => 'max-age=3600',
- ));
+ ]);
$this->assertEquals('max-age=3600, private', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('Last-Modified' => 'abcde'));
+ $bag = new ResponseHeaderBag(['Last-Modified' => 'abcde']);
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('Etag' => 'abcde', 'Last-Modified' => 'abcde'));
+ $bag = new ResponseHeaderBag(['Etag' => 'abcde', 'Last-Modified' => 'abcde']);
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('cache-control' => 'max-age=100'));
+ $bag = new ResponseHeaderBag(['cache-control' => 'max-age=100']);
$this->assertEquals('max-age=100, private', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('cache-control' => 's-maxage=100'));
+ $bag = new ResponseHeaderBag(['cache-control' => 's-maxage=100']);
$this->assertEquals('s-maxage=100', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('cache-control' => 'private, max-age=100'));
+ $bag = new ResponseHeaderBag(['cache-control' => 'private, max-age=100']);
$this->assertEquals('max-age=100, private', $bag->get('Cache-Control'));
- $bag = new ResponseHeaderBag(array('cache-control' => 'public, max-age=100'));
+ $bag = new ResponseHeaderBag(['cache-control' => 'public, max-age=100']);
$this->assertEquals('max-age=100, public', $bag->get('Cache-Control'));
$bag = new ResponseHeaderBag();
@@ -88,7 +88,7 @@ class ResponseHeaderBagTest extends TestCase
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
$bag = new ResponseHeaderBag();
- $bag->set('Cache-Control', array('public', 'must-revalidate'));
+ $bag->set('Cache-Control', ['public', 'must-revalidate']);
$this->assertCount(1, $bag->get('Cache-Control', null, false));
$this->assertEquals('must-revalidate, public', $bag->get('Cache-Control'));
@@ -101,7 +101,7 @@ class ResponseHeaderBagTest extends TestCase
public function testCacheControlClone()
{
- $headers = array('foo' => 'bar');
+ $headers = ['foo' => 'bar'];
$bag1 = new ResponseHeaderBag($headers);
$bag2 = new ResponseHeaderBag($bag1->allPreserveCase());
$this->assertEquals($bag1->allPreserveCase(), $bag2->allPreserveCase());
@@ -109,7 +109,7 @@ class ResponseHeaderBagTest extends TestCase
public function testToStringIncludesCookieHeaders()
{
- $bag = new ResponseHeaderBag(array());
+ $bag = new ResponseHeaderBag([]);
$bag->setCookie(Cookie::create('foo', 'bar'));
$this->assertSetCookieHeader('foo=bar; path=/; httponly; samesite=lax', $bag);
@@ -121,7 +121,7 @@ class ResponseHeaderBagTest extends TestCase
public function testClearCookieSecureNotHttpOnly()
{
- $bag = new ResponseHeaderBag(array());
+ $bag = new ResponseHeaderBag([]);
$bag->clearCookie('foo', '/', null, true, false);
@@ -130,23 +130,23 @@ class ResponseHeaderBagTest extends TestCase
public function testReplace()
{
- $bag = new ResponseHeaderBag(array());
+ $bag = new ResponseHeaderBag([]);
$this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
- $bag->replace(array('Cache-Control' => 'public'));
+ $bag->replace(['Cache-Control' => 'public']);
$this->assertEquals('public', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('public'));
}
public function testReplaceWithRemove()
{
- $bag = new ResponseHeaderBag(array());
+ $bag = new ResponseHeaderBag([]);
$this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
$bag->remove('Cache-Control');
- $bag->replace(array());
+ $bag->replace([]);
$this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
}
@@ -161,12 +161,12 @@ class ResponseHeaderBagTest extends TestCase
$this->assertCount(4, $bag->getCookies());
$this->assertEquals('foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax', $bag->get('set-cookie'));
- $this->assertEquals(array(
+ $this->assertEquals([
'foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax',
'foo=bar; path=/path/bar; domain=foo.bar; httponly; samesite=lax',
'foo=bar; path=/path/bar; domain=bar.foo; httponly; samesite=lax',
'foo=bar; path=/; httponly; samesite=lax',
- ), $bag->get('set-cookie', null, false));
+ ], $bag->get('set-cookie', null, false));
$this->assertSetCookieHeader('foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax', $bag);
$this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=foo.bar; httponly; samesite=lax', $bag);
@@ -228,16 +228,16 @@ class ResponseHeaderBagTest extends TestCase
{
$bag = new ResponseHeaderBag();
$bag->set('set-cookie', 'foo=bar');
- $this->assertEquals(array(Cookie::create('foo', 'bar', 0, '/', null, false, false, true, null)), $bag->getCookies());
+ $this->assertEquals([Cookie::create('foo', 'bar', 0, '/', null, false, false, true, null)], $bag->getCookies());
$bag->set('set-cookie', 'foo2=bar2', false);
- $this->assertEquals(array(
+ $this->assertEquals([
Cookie::create('foo', 'bar', 0, '/', null, false, false, true, null),
Cookie::create('foo2', 'bar2', 0, '/', null, false, false, true, null),
- ), $bag->getCookies());
+ ], $bag->getCookies());
$bag->remove('set-cookie');
- $this->assertEquals(array(), $bag->getCookies());
+ $this->assertEquals([], $bag->getCookies());
}
/**
@@ -260,8 +260,8 @@ class ResponseHeaderBagTest extends TestCase
(string) $headers;
$allHeaders = $headers->allPreserveCase();
- $this->assertEquals(array('http://www.symfony.com'), $allHeaders['Location']);
- $this->assertEquals(array('text/html'), $allHeaders['Content-type']);
+ $this->assertEquals(['http://www.symfony.com'], $allHeaders['Location']);
+ $this->assertEquals(['text/html'], $allHeaders['Content-type']);
}
public function testDateHeaderAddedOnCreation()
@@ -277,7 +277,7 @@ class ResponseHeaderBagTest extends TestCase
public function testDateHeaderCanBeSetOnCreation()
{
$someDate = 'Thu, 23 Mar 2017 09:15:12 GMT';
- $bag = new ResponseHeaderBag(array('Date' => $someDate));
+ $bag = new ResponseHeaderBag(['Date' => $someDate]);
$this->assertEquals($someDate, $bag->get('Date'));
}
@@ -285,7 +285,7 @@ class ResponseHeaderBagTest extends TestCase
public function testDateHeaderWillBeRecreatedWhenRemoved()
{
$someDate = 'Thu, 23 Mar 2017 09:15:12 GMT';
- $bag = new ResponseHeaderBag(array('Date' => $someDate));
+ $bag = new ResponseHeaderBag(['Date' => $someDate]);
$bag->remove('Date');
// a (new) Date header is still present
@@ -296,7 +296,7 @@ class ResponseHeaderBagTest extends TestCase
public function testDateHeaderWillBeRecreatedWhenHeadersAreReplaced()
{
$bag = new ResponseHeaderBag();
- $bag->replace(array());
+ $bag->replace([]);
$this->assertTrue($bag->has('Date'));
}
diff --git a/vendor/symfony/http-foundation/Tests/ResponseTest.php b/vendor/symfony/http-foundation/Tests/ResponseTest.php
index 03dcc11abd..adfae08b9e 100644
--- a/vendor/symfony/http-foundation/Tests/ResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/ResponseTest.php
@@ -22,7 +22,7 @@ class ResponseTest extends ResponseTestCase
{
public function testCreate()
{
- $response = Response::create('foo', 301, array('Foo' => 'bar'));
+ $response = Response::create('foo', 301, ['Foo' => 'bar']);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertEquals(301, $response->getStatusCode());
@@ -254,10 +254,10 @@ class ResponseTest extends ResponseTestCase
public function testIsValidateable()
{
- $response = new Response('', 200, array('Last-Modified' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822)));
+ $response = new Response('', 200, ['Last-Modified' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822)]);
$this->assertTrue($response->isValidateable(), '->isValidateable() returns true if Last-Modified is present');
- $response = new Response('', 200, array('ETag' => '"12345"'));
+ $response = new Response('', 200, ['ETag' => '"12345"']);
$this->assertTrue($response->isValidateable(), '->isValidateable() returns true if ETag is present');
$response = new Response();
@@ -267,7 +267,7 @@ class ResponseTest extends ResponseTestCase
public function testGetDate()
{
$oneHourAgo = $this->createDateTimeOneHourAgo();
- $response = new Response('', 200, array('Date' => $oneHourAgo->format(DATE_RFC2822)));
+ $response = new Response('', 200, ['Date' => $oneHourAgo->format(DATE_RFC2822)]);
$date = $response->getDate();
$this->assertEquals($oneHourAgo->getTimestamp(), $date->getTimestamp(), '->getDate() returns the Date header if present');
@@ -275,7 +275,7 @@ class ResponseTest extends ResponseTestCase
$date = $response->getDate();
$this->assertEquals(time(), $date->getTimestamp(), '->getDate() returns the current Date if no Date header present');
- $response = new Response('', 200, array('Date' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822)));
+ $response = new Response('', 200, ['Date' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822)]);
$now = $this->createDateTimeNow();
$response->headers->set('Date', $now->format(DATE_RFC2822));
$date = $response->getDate();
@@ -415,21 +415,21 @@ class ResponseTest extends ResponseTestCase
public function testGetVary()
{
$response = new Response();
- $this->assertEquals(array(), $response->getVary(), '->getVary() returns an empty array if no Vary header is present');
+ $this->assertEquals([], $response->getVary(), '->getVary() returns an empty array if no Vary header is present');
$response = new Response();
$response->headers->set('Vary', 'Accept-Language');
- $this->assertEquals(array('Accept-Language'), $response->getVary(), '->getVary() parses a single header name value');
+ $this->assertEquals(['Accept-Language'], $response->getVary(), '->getVary() parses a single header name value');
$response = new Response();
$response->headers->set('Vary', 'Accept-Language User-Agent X-Foo');
- $this->assertEquals(array('Accept-Language', 'User-Agent', 'X-Foo'), $response->getVary(), '->getVary() parses multiple header name values separated by spaces');
+ $this->assertEquals(['Accept-Language', 'User-Agent', 'X-Foo'], $response->getVary(), '->getVary() parses multiple header name values separated by spaces');
$response = new Response();
$response->headers->set('Vary', 'Accept-Language,User-Agent, X-Foo');
- $this->assertEquals(array('Accept-Language', 'User-Agent', 'X-Foo'), $response->getVary(), '->getVary() parses multiple header name values separated by commas');
+ $this->assertEquals(['Accept-Language', 'User-Agent', 'X-Foo'], $response->getVary(), '->getVary() parses multiple header name values separated by commas');
- $vary = array('Accept-Language', 'User-Agent', 'X-foo');
+ $vary = ['Accept-Language', 'User-Agent', 'X-foo'];
$response = new Response();
$response->headers->set('Vary', $vary);
@@ -444,18 +444,18 @@ class ResponseTest extends ResponseTestCase
{
$response = new Response();
$response->setVary('Accept-Language');
- $this->assertEquals(array('Accept-Language'), $response->getVary());
+ $this->assertEquals(['Accept-Language'], $response->getVary());
$response->setVary('Accept-Language, User-Agent');
- $this->assertEquals(array('Accept-Language', 'User-Agent'), $response->getVary(), '->setVary() replace the vary header by default');
+ $this->assertEquals(['Accept-Language', 'User-Agent'], $response->getVary(), '->setVary() replace the vary header by default');
$response->setVary('X-Foo', false);
- $this->assertEquals(array('Accept-Language', 'User-Agent', 'X-Foo'), $response->getVary(), '->setVary() doesn\'t wipe out earlier Vary headers if replace is set to false');
+ $this->assertEquals(['Accept-Language', 'User-Agent', 'X-Foo'], $response->getVary(), '->setVary() doesn\'t wipe out earlier Vary headers if replace is set to false');
}
public function testDefaultContentType()
{
- $headerMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\ResponseHeaderBag')->setMethods(array('set'))->getMock();
+ $headerMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\ResponseHeaderBag')->setMethods(['set'])->getMock();
$headerMock->expects($this->at(0))
->method('set')
->with('Content-Type', 'text/html');
@@ -595,55 +595,55 @@ class ResponseTest extends ResponseTestCase
public function testSetCache()
{
$response = new Response();
- //array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public')
+ // ['etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public']
try {
- $response->setCache(array('wrong option' => 'value'));
+ $response->setCache(['wrong option' => 'value']);
$this->fail('->setCache() throws an InvalidArgumentException if an option is not supported');
} catch (\Exception $e) {
$this->assertInstanceOf('InvalidArgumentException', $e, '->setCache() throws an InvalidArgumentException if an option is not supported');
$this->assertContains('"wrong option"', $e->getMessage());
}
- $options = array('etag' => '"whatever"');
+ $options = ['etag' => '"whatever"'];
$response->setCache($options);
$this->assertEquals($response->getEtag(), '"whatever"');
$now = $this->createDateTimeNow();
- $options = array('last_modified' => $now);
+ $options = ['last_modified' => $now];
$response->setCache($options);
$this->assertEquals($response->getLastModified()->getTimestamp(), $now->getTimestamp());
- $options = array('max_age' => 100);
+ $options = ['max_age' => 100];
$response->setCache($options);
$this->assertEquals($response->getMaxAge(), 100);
- $options = array('s_maxage' => 200);
+ $options = ['s_maxage' => 200];
$response->setCache($options);
$this->assertEquals($response->getMaxAge(), 200);
$this->assertTrue($response->headers->hasCacheControlDirective('public'));
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
- $response->setCache(array('public' => true));
+ $response->setCache(['public' => true]);
$this->assertTrue($response->headers->hasCacheControlDirective('public'));
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
- $response->setCache(array('public' => false));
+ $response->setCache(['public' => false]);
$this->assertFalse($response->headers->hasCacheControlDirective('public'));
$this->assertTrue($response->headers->hasCacheControlDirective('private'));
- $response->setCache(array('private' => true));
+ $response->setCache(['private' => true]);
$this->assertFalse($response->headers->hasCacheControlDirective('public'));
$this->assertTrue($response->headers->hasCacheControlDirective('private'));
- $response->setCache(array('private' => false));
+ $response->setCache(['private' => false]);
$this->assertTrue($response->headers->hasCacheControlDirective('public'));
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
- $response->setCache(array('immutable' => true));
+ $response->setCache(['immutable' => true]);
$this->assertTrue($response->headers->hasCacheControlDirective('immutable'));
- $response->setCache(array('immutable' => false));
+ $response->setCache(['immutable' => false]);
$this->assertFalse($response->headers->hasCacheControlDirective('immutable'));
}
@@ -780,14 +780,14 @@ class ResponseTest extends ResponseTestCase
public function getStatusCodeFixtures()
{
- return array(
- array('200', null, 'OK'),
- array('200', false, ''),
- array('200', 'foo', 'foo'),
- array('199', null, 'unknown status'),
- array('199', false, ''),
- array('199', 'foo', 'foo'),
- );
+ return [
+ ['200', null, 'OK'],
+ ['200', false, ''],
+ ['200', 'foo', 'foo'],
+ ['199', null, 'unknown status'],
+ ['199', false, ''],
+ ['199', 'foo', 'foo'],
+ ];
}
public function testIsInformational()
@@ -801,7 +801,7 @@ class ResponseTest extends ResponseTestCase
public function testIsRedirectRedirection()
{
- foreach (array(301, 302, 303, 307) as $code) {
+ foreach ([301, 302, 303, 307] as $code) {
$response = new Response('', $code);
$this->assertTrue($response->isRedirection());
$this->assertTrue($response->isRedirect());
@@ -819,7 +819,7 @@ class ResponseTest extends ResponseTestCase
$this->assertFalse($response->isRedirection());
$this->assertFalse($response->isRedirect());
- $response = new Response('', 301, array('Location' => '/good-uri'));
+ $response = new Response('', 301, ['Location' => '/good-uri']);
$this->assertFalse($response->isRedirect('/bad-uri'));
$this->assertTrue($response->isRedirect('/good-uri'));
}
@@ -835,7 +835,7 @@ class ResponseTest extends ResponseTestCase
public function testIsEmpty()
{
- foreach (array(204, 304) as $code) {
+ foreach ([204, 304] as $code) {
$response = new Response('', $code);
$this->assertTrue($response->isEmpty());
}
@@ -884,7 +884,7 @@ class ResponseTest extends ResponseTestCase
public function testSetEtag()
{
- $response = new Response('', 200, array('ETag' => '"12345"'));
+ $response = new Response('', 200, ['ETag' => '"12345"']);
$response->setEtag();
$this->assertNull($response->headers->get('Etag'), '->setEtag() removes Etags when call with null');
@@ -914,7 +914,7 @@ class ResponseTest extends ResponseTestCase
{
$response = new Response();
- $setters = array(
+ $setters = [
'setProtocolVersion' => '1.0',
'setCharset' => 'UTF-8',
'setPublic' => null,
@@ -925,7 +925,7 @@ class ResponseTest extends ResponseTestCase
'setSharedMaxAge' => 1,
'setTtl' => 1,
'setClientTtl' => 1,
- );
+ ];
foreach ($setters as $setter => $arg) {
$this->assertEquals($response, $response->{$setter}($arg));
@@ -944,20 +944,20 @@ class ResponseTest extends ResponseTestCase
public function validContentProvider()
{
- return array(
- 'obj' => array(new StringableObject()),
- 'string' => array('Foo'),
- 'int' => array(2),
- );
+ return [
+ 'obj' => [new StringableObject()],
+ 'string' => ['Foo'],
+ 'int' => [2],
+ ];
}
public function invalidContentProvider()
{
- return array(
- 'obj' => array(new \stdClass()),
- 'array' => array(array()),
- 'bool' => array(true, '1'),
- );
+ return [
+ 'obj' => [new \stdClass()],
+ 'array' => [[]],
+ 'bool' => [true, '1'],
+ ];
}
protected function createDateTimeOneHourAgo()
@@ -1004,19 +1004,19 @@ class ResponseTest extends ResponseTestCase
$ianaHttpStatusCodes = new \DOMDocument();
- libxml_set_streams_context(stream_context_create(array(
- 'http' => array(
+ libxml_set_streams_context(stream_context_create([
+ 'http' => [
'method' => 'GET',
'timeout' => 30,
- ),
- )));
+ ],
+ ]));
$ianaHttpStatusCodes->load('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml');
if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) {
self::fail('Invalid IANA\'s HTTP status code list.');
}
- $ianaCodesReasonPhrases = array();
+ $ianaCodesReasonPhrases = [];
$xpath = new \DOMXPath($ianaHttpStatusCodes);
$xpath->registerNamespace('ns', 'http://www.iana.org/assignments');
@@ -1026,16 +1026,16 @@ class ResponseTest extends ResponseTestCase
$value = $xpath->query('.//ns:value', $record)->item(0)->nodeValue;
$description = $xpath->query('.//ns:description', $record)->item(0)->nodeValue;
- if (\in_array($description, array('Unassigned', '(Unused)'), true)) {
+ if (\in_array($description, ['Unassigned', '(Unused)'], true)) {
continue;
}
if (preg_match('/^([0-9]+)\s*\-\s*([0-9]+)$/', $value, $matches)) {
for ($value = $matches[1]; $value <= $matches[2]; ++$value) {
- $ianaCodesReasonPhrases[] = array($value, $description);
+ $ianaCodesReasonPhrases[] = [$value, $description];
}
} else {
- $ianaCodesReasonPhrases[] = array($value, $description);
+ $ianaCodesReasonPhrases[] = [$value, $description];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/ServerBagTest.php b/vendor/symfony/http-foundation/Tests/ServerBagTest.php
index f8becec5a9..0663b118e6 100644
--- a/vendor/symfony/http-foundation/Tests/ServerBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/ServerBagTest.php
@@ -23,7 +23,7 @@ class ServerBagTest extends TestCase
{
public function testShouldExtractHeadersFromServerArray()
{
- $server = array(
+ $server = [
'SOME_SERVER_VARIABLE' => 'value',
'SOME_SERVER_VARIABLE2' => 'value',
'ROOT' => 'value',
@@ -32,45 +32,45 @@ class ServerBagTest extends TestCase
'HTTP_ETAG' => 'asdf',
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => 'bar',
- );
+ ];
$bag = new ServerBag($server);
- $this->assertEquals(array(
+ $this->assertEquals([
'CONTENT_TYPE' => 'text/html',
'CONTENT_LENGTH' => '0',
'ETAG' => 'asdf',
'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'),
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => 'bar',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpPasswordIsOptional()
{
- $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo'));
+ $bag = new ServerBag(['PHP_AUTH_USER' => 'foo']);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => 'Basic '.base64_encode('foo:'),
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => '',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpBasicAuthWithPhpCgi()
{
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:bar')));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:bar')]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'),
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => 'bar',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpBasicAuthWithPhpCgiBogus()
{
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic_'.base64_encode('foo:bar')));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => 'Basic_'.base64_encode('foo:bar')]);
// Username and passwords should not be set as the header is bogus
$headers = $bag->getHeaders();
@@ -80,41 +80,41 @@ class ServerBagTest extends TestCase
public function testHttpBasicAuthWithPhpCgiRedirect()
{
- $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word')));
+ $bag = new ServerBag(['REDIRECT_HTTP_AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word')]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word'),
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'pass:word',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpBasicAuthWithPhpCgiEmptyPassword()
{
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:')));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:')]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => 'Basic '.base64_encode('foo:'),
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => '',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpDigestAuthWithPhpCgi()
{
$digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"';
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $digest));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => $digest]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => $digest,
'PHP_AUTH_DIGEST' => $digest,
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testHttpDigestAuthWithPhpCgiBogus()
{
$digest = 'Digest_username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"';
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $digest));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => $digest]);
// Username and passwords should not be set as the header is bogus
$headers = $bag->getHeaders();
@@ -125,32 +125,32 @@ class ServerBagTest extends TestCase
public function testHttpDigestAuthWithPhpCgiRedirect()
{
$digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"';
- $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => $digest));
+ $bag = new ServerBag(['REDIRECT_HTTP_AUTHORIZATION' => $digest]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => $digest,
'PHP_AUTH_DIGEST' => $digest,
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testOAuthBearerAuth()
{
$headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo';
- $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $headerContent));
+ $bag = new ServerBag(['HTTP_AUTHORIZATION' => $headerContent]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => $headerContent,
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
public function testOAuthBearerAuthWithRedirect()
{
$headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo';
- $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => $headerContent));
+ $bag = new ServerBag(['REDIRECT_HTTP_AUTHORIZATION' => $headerContent]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => $headerContent,
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
/**
@@ -159,12 +159,12 @@ class ServerBagTest extends TestCase
public function testItDoesNotOverwriteTheAuthorizationHeaderIfItIsAlreadySet()
{
$headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo';
- $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo', 'HTTP_AUTHORIZATION' => $headerContent));
+ $bag = new ServerBag(['PHP_AUTH_USER' => 'foo', 'HTTP_AUTHORIZATION' => $headerContent]);
- $this->assertEquals(array(
+ $this->assertEquals([
'AUTHORIZATION' => $headerContent,
'PHP_AUTH_USER' => 'foo',
'PHP_AUTH_PW' => '',
- ), $bag->getHeaders());
+ ], $bag->getHeaders());
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
index 8c41e47510..44c8174e30 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
*/
class AttributeBagTest extends TestCase
{
- private $array = array();
+ private $array = [];
/**
* @var AttributeBag
@@ -30,21 +30,21 @@ class AttributeBagTest extends TestCase
protected function setUp()
{
- $this->array = array(
+ $this->array = [
'hello' => 'world',
'always' => 'be happy',
'user.login' => 'drak',
- 'csrf.token' => array(
+ 'csrf.token' => [
'a' => '1234',
'b' => '4321',
- ),
- 'category' => array(
- 'fishing' => array(
+ ],
+ 'category' => [
+ 'fishing' => [
'first' => 'cod',
'second' => 'sole',
- ),
- ),
- );
+ ],
+ ],
+ ];
$this->bag = new AttributeBag('_sf');
$this->bag->initialize($this->array);
}
@@ -52,7 +52,7 @@ class AttributeBagTest extends TestCase
protected function tearDown()
{
$this->bag = null;
- $this->array = array();
+ $this->array = [];
}
public function testInitialize()
@@ -60,7 +60,7 @@ class AttributeBagTest extends TestCase
$bag = new AttributeBag();
$bag->initialize($this->array);
$this->assertEquals($this->array, $bag->all());
- $array = array('should' => 'change');
+ $array = ['should' => 'change'];
$bag->initialize($array);
$this->assertEquals($array, $bag->all());
}
@@ -122,7 +122,7 @@ class AttributeBagTest extends TestCase
public function testReplace()
{
- $array = array();
+ $array = [];
$array['name'] = 'jack';
$array['foo.bar'] = 'beep';
$this->bag->replace($array);
@@ -150,22 +150,22 @@ class AttributeBagTest extends TestCase
public function testClear()
{
$this->bag->clear();
- $this->assertEquals(array(), $this->bag->all());
+ $this->assertEquals([], $this->bag->all());
}
public function attributesProvider()
{
- return array(
- array('hello', 'world', true),
- array('always', 'be happy', true),
- array('user.login', 'drak', true),
- array('csrf.token', array('a' => '1234', 'b' => '4321'), true),
- array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), true),
- array('user2.login', null, false),
- array('never', null, false),
- array('bye', null, false),
- array('bye/for/now', null, false),
- );
+ return [
+ ['hello', 'world', true],
+ ['always', 'be happy', true],
+ ['user.login', 'drak', true],
+ ['csrf.token', ['a' => '1234', 'b' => '4321'], true],
+ ['category', ['fishing' => ['first' => 'cod', 'second' => 'sole']], true],
+ ['user2.login', null, false],
+ ['never', null, false],
+ ['bye', null, false],
+ ['bye/for/now', null, false],
+ ];
}
public function testGetIterator()
diff --git a/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php
index ec4cd5ad1a..6b4bb17d69 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php
@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;
*/
class NamespacedAttributeBagTest extends TestCase
{
- private $array = array();
+ private $array = [];
/**
* @var NamespacedAttributeBag
@@ -30,21 +30,21 @@ class NamespacedAttributeBagTest extends TestCase
protected function setUp()
{
- $this->array = array(
+ $this->array = [
'hello' => 'world',
'always' => 'be happy',
'user.login' => 'drak',
- 'csrf.token' => array(
+ 'csrf.token' => [
'a' => '1234',
'b' => '4321',
- ),
- 'category' => array(
- 'fishing' => array(
+ ],
+ 'category' => [
+ 'fishing' => [
'first' => 'cod',
'second' => 'sole',
- ),
- ),
- );
+ ],
+ ],
+ ];
$this->bag = new NamespacedAttributeBag('_sf2', '/');
$this->bag->initialize($this->array);
}
@@ -52,7 +52,7 @@ class NamespacedAttributeBagTest extends TestCase
protected function tearDown()
{
$this->bag = null;
- $this->array = array();
+ $this->array = [];
}
public function testInitialize()
@@ -60,7 +60,7 @@ class NamespacedAttributeBagTest extends TestCase
$bag = new NamespacedAttributeBag();
$bag->initialize($this->array);
$this->assertEquals($this->array, $this->bag->all());
- $array = array('should' => 'not stick');
+ $array = ['should' => 'not stick'];
$bag->initialize($array);
// should have remained the same
@@ -139,7 +139,7 @@ class NamespacedAttributeBagTest extends TestCase
public function testReplace()
{
- $array = array();
+ $array = [];
$array['name'] = 'jack';
$array['foo.bar'] = 'beep';
$this->bag->replace($array);
@@ -177,28 +177,28 @@ class NamespacedAttributeBagTest extends TestCase
public function testClear()
{
$this->bag->clear();
- $this->assertEquals(array(), $this->bag->all());
+ $this->assertEquals([], $this->bag->all());
}
public function attributesProvider()
{
- return array(
- array('hello', 'world', true),
- array('always', 'be happy', true),
- array('user.login', 'drak', true),
- array('csrf.token', array('a' => '1234', 'b' => '4321'), true),
- array('csrf.token/a', '1234', true),
- array('csrf.token/b', '4321', true),
- array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), true),
- array('category/fishing', array('first' => 'cod', 'second' => 'sole'), true),
- array('category/fishing/missing/first', null, false),
- array('category/fishing/first', 'cod', true),
- array('category/fishing/second', 'sole', true),
- array('category/fishing/missing/second', null, false),
- array('user2.login', null, false),
- array('never', null, false),
- array('bye', null, false),
- array('bye/for/now', null, false),
- );
+ return [
+ ['hello', 'world', true],
+ ['always', 'be happy', true],
+ ['user.login', 'drak', true],
+ ['csrf.token', ['a' => '1234', 'b' => '4321'], true],
+ ['csrf.token/a', '1234', true],
+ ['csrf.token/b', '4321', true],
+ ['category', ['fishing' => ['first' => 'cod', 'second' => 'sole']], true],
+ ['category/fishing', ['first' => 'cod', 'second' => 'sole'], true],
+ ['category/fishing/missing/first', null, false],
+ ['category/fishing/first', 'cod', true],
+ ['category/fishing/second', 'sole', true],
+ ['category/fishing/missing/second', null, false],
+ ['user2.login', null, false],
+ ['never', null, false],
+ ['bye', null, false],
+ ['bye/for/now', null, false],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php
index fa8626ab92..b4e2c3a5ad 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php
@@ -26,13 +26,13 @@ class AutoExpireFlashBagTest extends TestCase
*/
private $bag;
- protected $array = array();
+ protected $array = [];
protected function setUp()
{
parent::setUp();
$this->bag = new FlashBag();
- $this->array = array('new' => array('notice' => array('A previous flash message')));
+ $this->array = ['new' => ['notice' => ['A previous flash message']]];
$this->bag->initialize($this->array);
}
@@ -45,16 +45,16 @@ class AutoExpireFlashBagTest extends TestCase
public function testInitialize()
{
$bag = new FlashBag();
- $array = array('new' => array('notice' => array('A previous flash message')));
+ $array = ['new' => ['notice' => ['A previous flash message']]];
$bag->initialize($array);
- $this->assertEquals(array('A previous flash message'), $bag->peek('notice'));
- $array = array('new' => array(
- 'notice' => array('Something else'),
- 'error' => array('a'),
- ));
+ $this->assertEquals(['A previous flash message'], $bag->peek('notice'));
+ $array = ['new' => [
+ 'notice' => ['Something else'],
+ 'error' => ['a'],
+ ]];
$bag->initialize($array);
- $this->assertEquals(array('Something else'), $bag->peek('notice'));
- $this->assertEquals(array('a'), $bag->peek('error'));
+ $this->assertEquals(['Something else'], $bag->peek('notice'));
+ $this->assertEquals(['a'], $bag->peek('error'));
}
public function testGetStorageKey()
@@ -73,16 +73,16 @@ class AutoExpireFlashBagTest extends TestCase
public function testPeek()
{
- $this->assertEquals(array(), $this->bag->peek('non_existing'));
- $this->assertEquals(array('default'), $this->bag->peek('non_existing', array('default')));
- $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
- $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
+ $this->assertEquals([], $this->bag->peek('non_existing'));
+ $this->assertEquals(['default'], $this->bag->peek('non_existing', ['default']));
+ $this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
+ $this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
}
public function testSet()
{
$this->bag->set('notice', 'Foo');
- $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
+ $this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
}
public function testHas()
@@ -93,43 +93,43 @@ class AutoExpireFlashBagTest extends TestCase
public function testKeys()
{
- $this->assertEquals(array('notice'), $this->bag->keys());
+ $this->assertEquals(['notice'], $this->bag->keys());
}
public function testPeekAll()
{
- $array = array(
- 'new' => array(
+ $array = [
+ 'new' => [
'notice' => 'Foo',
'error' => 'Bar',
- ),
- );
+ ],
+ ];
$this->bag->initialize($array);
- $this->assertEquals(array(
+ $this->assertEquals([
'notice' => 'Foo',
'error' => 'Bar',
- ), $this->bag->peekAll()
+ ], $this->bag->peekAll()
);
- $this->assertEquals(array(
+ $this->assertEquals([
'notice' => 'Foo',
'error' => 'Bar',
- ), $this->bag->peekAll()
+ ], $this->bag->peekAll()
);
}
public function testGet()
{
- $this->assertEquals(array(), $this->bag->get('non_existing'));
- $this->assertEquals(array('default'), $this->bag->get('non_existing', array('default')));
- $this->assertEquals(array('A previous flash message'), $this->bag->get('notice'));
- $this->assertEquals(array(), $this->bag->get('notice'));
+ $this->assertEquals([], $this->bag->get('non_existing'));
+ $this->assertEquals(['default'], $this->bag->get('non_existing', ['default']));
+ $this->assertEquals(['A previous flash message'], $this->bag->get('notice'));
+ $this->assertEquals([], $this->bag->get('notice'));
}
public function testSetAll()
{
- $this->bag->setAll(array('a' => 'first', 'b' => 'second'));
+ $this->bag->setAll(['a' => 'first', 'b' => 'second']);
$this->assertFalse($this->bag->has('a'));
$this->assertFalse($this->bag->has('b'));
}
@@ -138,17 +138,17 @@ class AutoExpireFlashBagTest extends TestCase
{
$this->bag->set('notice', 'Foo');
$this->bag->set('error', 'Bar');
- $this->assertEquals(array(
- 'notice' => array('A previous flash message'),
- ), $this->bag->all()
+ $this->assertEquals([
+ 'notice' => ['A previous flash message'],
+ ], $this->bag->all()
);
- $this->assertEquals(array(), $this->bag->all());
+ $this->assertEquals([], $this->bag->all());
}
public function testClear()
{
- $this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear());
+ $this->assertEquals(['notice' => ['A previous flash message']], $this->bag->clear());
}
public function testDoNotRemoveTheNewFlashesWhenDisplayingTheExistingOnes()
@@ -156,6 +156,6 @@ class AutoExpireFlashBagTest extends TestCase
$this->bag->add('success', 'Something');
$this->bag->all();
- $this->assertEquals(array('new' => array('success' => array('Something')), 'display' => array()), $this->array);
+ $this->assertEquals(['new' => ['success' => ['Something']], 'display' => []], $this->array);
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php
index 905a1f7517..6d8619e078 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php
@@ -26,13 +26,13 @@ class FlashBagTest extends TestCase
*/
private $bag;
- protected $array = array();
+ protected $array = [];
protected function setUp()
{
parent::setUp();
$this->bag = new FlashBag();
- $this->array = array('notice' => array('A previous flash message'));
+ $this->array = ['notice' => ['A previous flash message']];
$this->bag->initialize($this->array);
}
@@ -47,7 +47,7 @@ class FlashBagTest extends TestCase
$bag = new FlashBag();
$bag->initialize($this->array);
$this->assertEquals($this->array, $bag->peekAll());
- $array = array('should' => array('change'));
+ $array = ['should' => ['change']];
$bag->initialize($array);
$this->assertEquals($array, $bag->peekAll());
}
@@ -68,49 +68,49 @@ class FlashBagTest extends TestCase
public function testPeek()
{
- $this->assertEquals(array(), $this->bag->peek('non_existing'));
- $this->assertEquals(array('default'), $this->bag->peek('not_existing', array('default')));
- $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
- $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
+ $this->assertEquals([], $this->bag->peek('non_existing'));
+ $this->assertEquals(['default'], $this->bag->peek('not_existing', ['default']));
+ $this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
+ $this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
}
public function testAdd()
{
- $tab = array('bar' => 'baz');
+ $tab = ['bar' => 'baz'];
$this->bag->add('string_message', 'lorem');
$this->bag->add('object_message', new \stdClass());
$this->bag->add('array_message', $tab);
- $this->assertEquals(array('lorem'), $this->bag->get('string_message'));
- $this->assertEquals(array(new \stdClass()), $this->bag->get('object_message'));
- $this->assertEquals(array($tab), $this->bag->get('array_message'));
+ $this->assertEquals(['lorem'], $this->bag->get('string_message'));
+ $this->assertEquals([new \stdClass()], $this->bag->get('object_message'));
+ $this->assertEquals([$tab], $this->bag->get('array_message'));
}
public function testGet()
{
- $this->assertEquals(array(), $this->bag->get('non_existing'));
- $this->assertEquals(array('default'), $this->bag->get('not_existing', array('default')));
- $this->assertEquals(array('A previous flash message'), $this->bag->get('notice'));
- $this->assertEquals(array(), $this->bag->get('notice'));
+ $this->assertEquals([], $this->bag->get('non_existing'));
+ $this->assertEquals(['default'], $this->bag->get('not_existing', ['default']));
+ $this->assertEquals(['A previous flash message'], $this->bag->get('notice'));
+ $this->assertEquals([], $this->bag->get('notice'));
}
public function testAll()
{
$this->bag->set('notice', 'Foo');
$this->bag->set('error', 'Bar');
- $this->assertEquals(array(
- 'notice' => array('Foo'),
- 'error' => array('Bar'), ), $this->bag->all()
+ $this->assertEquals([
+ 'notice' => ['Foo'],
+ 'error' => ['Bar'], ], $this->bag->all()
);
- $this->assertEquals(array(), $this->bag->all());
+ $this->assertEquals([], $this->bag->all());
}
public function testSet()
{
$this->bag->set('notice', 'Foo');
$this->bag->set('notice', 'Bar');
- $this->assertEquals(array('Bar'), $this->bag->peek('notice'));
+ $this->assertEquals(['Bar'], $this->bag->peek('notice'));
}
public function testHas()
@@ -121,7 +121,7 @@ class FlashBagTest extends TestCase
public function testKeys()
{
- $this->assertEquals(array('notice'), $this->bag->keys());
+ $this->assertEquals(['notice'], $this->bag->keys());
}
public function testSetAll()
@@ -130,28 +130,28 @@ class FlashBagTest extends TestCase
$this->bag->add('another_flash', 'Bar');
$this->assertTrue($this->bag->has('one_flash'));
$this->assertTrue($this->bag->has('another_flash'));
- $this->bag->setAll(array('unique_flash' => 'FooBar'));
+ $this->bag->setAll(['unique_flash' => 'FooBar']);
$this->assertFalse($this->bag->has('one_flash'));
$this->assertFalse($this->bag->has('another_flash'));
- $this->assertSame(array('unique_flash' => 'FooBar'), $this->bag->all());
- $this->assertSame(array(), $this->bag->all());
+ $this->assertSame(['unique_flash' => 'FooBar'], $this->bag->all());
+ $this->assertSame([], $this->bag->all());
}
public function testPeekAll()
{
$this->bag->set('notice', 'Foo');
$this->bag->set('error', 'Bar');
- $this->assertEquals(array(
- 'notice' => array('Foo'),
- 'error' => array('Bar'),
- ), $this->bag->peekAll()
+ $this->assertEquals([
+ 'notice' => ['Foo'],
+ 'error' => ['Bar'],
+ ], $this->bag->peekAll()
);
$this->assertTrue($this->bag->has('notice'));
$this->assertTrue($this->bag->has('error'));
- $this->assertEquals(array(
- 'notice' => array('Foo'),
- 'error' => array('Bar'),
- ), $this->bag->peekAll()
+ $this->assertEquals([
+ 'notice' => ['Foo'],
+ 'error' => ['Bar'],
+ ], $this->bag->peekAll()
);
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/SessionTest.php b/vendor/symfony/http-foundation/Tests/Session/SessionTest.php
index 63351e575a..afa00fc7c3 100644
--- a/vendor/symfony/http-foundation/Tests/Session/SessionTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/SessionTest.php
@@ -127,10 +127,10 @@ class SessionTest extends TestCase
public function testReplace()
{
- $this->session->replace(array('happiness' => 'be good', 'symfony' => 'awesome'));
- $this->assertEquals(array('happiness' => 'be good', 'symfony' => 'awesome'), $this->session->all());
- $this->session->replace(array());
- $this->assertEquals(array(), $this->session->all());
+ $this->session->replace(['happiness' => 'be good', 'symfony' => 'awesome']);
+ $this->assertEquals(['happiness' => 'be good', 'symfony' => 'awesome'], $this->session->all());
+ $this->session->replace([]);
+ $this->assertEquals([], $this->session->all());
}
/**
@@ -150,16 +150,16 @@ class SessionTest extends TestCase
$this->session->set('hi', 'fabien');
$this->session->set($key, $value);
$this->session->clear();
- $this->assertEquals(array(), $this->session->all());
+ $this->assertEquals([], $this->session->all());
}
public function setProvider()
{
- return array(
- array('foo', 'bar', array('foo' => 'bar')),
- array('foo.bar', 'too much beer', array('foo.bar' => 'too much beer')),
- array('great', 'symfony is great', array('great' => 'symfony is great')),
- );
+ return [
+ ['foo', 'bar', ['foo' => 'bar']],
+ ['foo.bar', 'too much beer', ['foo.bar' => 'too much beer']],
+ ['great', 'symfony is great', ['great' => 'symfony is great']],
+ ];
}
/**
@@ -170,14 +170,14 @@ class SessionTest extends TestCase
$this->session->set('hi.world', 'have a nice day');
$this->session->set($key, $value);
$this->session->remove($key);
- $this->assertEquals(array('hi.world' => 'have a nice day'), $this->session->all());
+ $this->assertEquals(['hi.world' => 'have a nice day'], $this->session->all());
}
public function testInvalidate()
{
$this->session->set('invalidate', 123);
$this->session->invalidate();
- $this->assertEquals(array(), $this->session->all());
+ $this->assertEquals([], $this->session->all());
}
public function testMigrate()
@@ -216,7 +216,7 @@ class SessionTest extends TestCase
public function testGetIterator()
{
- $attributes = array('hello' => 'world', 'symfony' => 'rocks');
+ $attributes = ['hello' => 'world', 'symfony' => 'rocks'];
foreach ($attributes as $key => $val) {
$this->session->set($key, $val);
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php
index a2bf168de4..c0651498f2 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php
@@ -50,7 +50,7 @@ abstract class AbstractRedisSessionHandlerTestCase extends TestCase
$this->redisClient = $this->createRedisClient($host);
$this->storage = new RedisSessionHandler(
$this->redisClient,
- array('prefix' => self::PREFIX)
+ ['prefix' => self::PREFIX]
);
}
@@ -117,7 +117,7 @@ abstract class AbstractRedisSessionHandlerTestCase extends TestCase
$lowTtl = 10;
$this->redisClient->setex(self::PREFIX.'id', $lowTtl, 'foo');
- $this->storage->updateTimestamp('id', array());
+ $this->storage->updateTimestamp('id', []);
$this->assertGreaterThan($lowTtl, $this->redisClient->ttl(self::PREFIX.'id'));
}
@@ -137,9 +137,9 @@ abstract class AbstractRedisSessionHandlerTestCase extends TestCase
public function getOptionFixtures(): array
{
- return array(
- array(array('prefix' => 'session'), true),
- array(array('prefix' => 'sfs', 'foo' => 'bar'), false),
- );
+ return [
+ [['prefix' => 'session'], true],
+ [['prefix' => 'sfs', 'foo' => 'bar'], false],
+ ];
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php
index 6566d6eee4..f65e62b506 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php
@@ -19,10 +19,10 @@ class AbstractSessionHandlerTest extends TestCase
public static function setUpBeforeClass()
{
- $spec = array(
- 1 => array('file', '/dev/null', 'w'),
- 2 => array('file', '/dev/null', 'w'),
- );
+ $spec = [
+ 1 => ['file', '/dev/null', 'w'],
+ 2 => ['file', '/dev/null', 'w'],
+ ];
if (!self::$server = @proc_open('exec php -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) {
self::markTestSkipped('PHP server unable to start.');
}
@@ -42,7 +42,7 @@ class AbstractSessionHandlerTest extends TestCase
*/
public function testSession($fixture)
{
- $context = array('http' => array('header' => "Cookie: sid=123abc\r\n"));
+ $context = ['http' => ['header' => "Cookie: sid=123abc\r\n"]];
$context = stream_context_create($context);
$result = file_get_contents(sprintf('http://localhost:8053/%s.php', $fixture), false, $context);
@@ -52,7 +52,7 @@ class AbstractSessionHandlerTest extends TestCase
public function provideSession()
{
foreach (glob(__DIR__.'/Fixtures/*.php') as $file) {
- yield array(pathinfo($file, PATHINFO_FILENAME));
+ yield [pathinfo($file, PATHINFO_FILENAME)];
}
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
index 2d32792a8f..fc2c418289 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
@@ -4,10 +4,10 @@ require __DIR__.'/common.inc';
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
-$storage = new NativeSessionStorage(array('cookie_samesite' => 'lax'));
+$storage = new NativeSessionStorage(['cookie_samesite' => 'lax']);
$storage->setSaveHandler(new TestSessionHandler());
$storage->start();
-$_SESSION = array('foo' => 'bar');
+$_SESSION = ['foo' => 'bar'];
ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php
index e0ff64b951..a28b6fedfc 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php
@@ -4,11 +4,11 @@ require __DIR__.'/common.inc';
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
-$storage = new NativeSessionStorage(array('cookie_samesite' => 'lax'));
+$storage = new NativeSessionStorage(['cookie_samesite' => 'lax']);
$storage->setSaveHandler(new TestSessionHandler());
$storage->start();
-$_SESSION = array('foo' => 'bar');
+$_SESSION = ['foo' => 'bar'];
$storage->regenerate(true);
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
index 5bb2db0699..5c72a89aa5 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
@@ -41,7 +41,7 @@ class MemcachedSessionHandlerTest extends TestCase
$this->memcached = $this->getMockBuilder('Memcached')->getMock();
$this->storage = new MemcachedSessionHandler(
$this->memcached,
- array('prefix' => self::PREFIX, 'expiretime' => self::TTL)
+ ['prefix' => self::PREFIX, 'expiretime' => self::TTL]
);
}
@@ -59,6 +59,12 @@ class MemcachedSessionHandlerTest extends TestCase
public function testCloseSession()
{
+ $this->memcached
+ ->expects($this->once())
+ ->method('quit')
+ ->will($this->returnValue(true))
+ ;
+
$this->assertTrue($this->storage->close());
}
@@ -117,12 +123,12 @@ class MemcachedSessionHandlerTest extends TestCase
public function getOptionFixtures()
{
- return array(
- array(array('prefix' => 'session'), true),
- array(array('expiretime' => 100), true),
- array(array('prefix' => 'session', 'expiretime' => 200), true),
- array(array('expiretime' => 100, 'foo' => 'bar'), false),
- );
+ return [
+ [['prefix' => 'session'], true],
+ [['expiretime' => 100], true],
+ [['prefix' => 'session', 'expiretime' => 200], true],
+ [['expiretime' => 100, 'foo' => 'bar'], false],
+ ];
}
public function testGetConnection()
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
index c585fd4f1b..891516d523 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
@@ -40,14 +40,14 @@ class MongoDbSessionHandlerTest extends TestCase
->disableOriginalConstructor()
->getMock();
- $this->options = array(
+ $this->options = [
'id_field' => '_id',
'data_field' => 'data',
'time_field' => 'time',
'expiry_field' => 'expires_at',
'database' => 'sf-test',
'collection' => 'session-test',
- );
+ ];
$this->storage = new MongoDbSessionHandler($this->mongo, $this->options);
}
@@ -57,7 +57,7 @@ class MongoDbSessionHandlerTest extends TestCase
*/
public function testConstructorShouldThrowExceptionForMissingOptions()
{
- new MongoDbSessionHandler($this->mongo, array());
+ new MongoDbSessionHandler($this->mongo, []);
}
public function testOpenMethodAlwaysReturnTrue()
@@ -95,11 +95,11 @@ class MongoDbSessionHandlerTest extends TestCase
$this->assertInstanceOf(\MongoDB\BSON\UTCDateTime::class, $criteria[$this->options['expiry_field']]['$gte']);
$this->assertGreaterThanOrEqual(round((string) $criteria[$this->options['expiry_field']]['$gte'] / 1000), $testTimeout);
- return array(
+ return [
$this->options['id_field'] => 'foo',
$this->options['expiry_field'] => new \MongoDB\BSON\UTCDateTime(),
$this->options['data_field'] => new \MongoDB\BSON\Binary('bar', \MongoDB\BSON\Binary::TYPE_OLD_BINARY),
- );
+ ];
}));
$this->assertEquals('bar', $this->storage->read('foo'));
@@ -117,8 +117,8 @@ class MongoDbSessionHandlerTest extends TestCase
$collection->expects($this->once())
->method('updateOne')
->will($this->returnCallback(function ($criteria, $updateData, $options) {
- $this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria);
- $this->assertEquals(array('upsert' => true), $options);
+ $this->assertEquals([$this->options['id_field'] => 'foo'], $criteria);
+ $this->assertEquals(['upsert' => true], $options);
$data = $updateData['$set'];
$expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime');
@@ -141,7 +141,7 @@ class MongoDbSessionHandlerTest extends TestCase
->with($this->options['database'], $this->options['collection'])
->will($this->returnValue($collection));
- $data = array();
+ $data = [];
$collection->expects($this->exactly(2))
->method('updateOne')
@@ -166,7 +166,7 @@ class MongoDbSessionHandlerTest extends TestCase
$collection->expects($this->once())
->method('deleteOne')
- ->with(array($this->options['id_field'] => 'foo'));
+ ->with([$this->options['id_field'] => 'foo']);
$this->assertTrue($this->storage->destroy('foo'));
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
index 95e725f4bc..e227bebf62 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
@@ -27,7 +27,7 @@ class NativeFileSessionHandlerTest extends TestCase
{
public function testConstruct()
{
- $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir()));
+ $storage = new NativeSessionStorage(['name' => 'TESTING'], new NativeFileSessionHandler(sys_get_temp_dir()));
$this->assertEquals('user', ini_get('session.save_handler'));
@@ -51,11 +51,11 @@ class NativeFileSessionHandlerTest extends TestCase
{
$base = sys_get_temp_dir();
- return array(
- array("$base/foo", "$base/foo", "$base/foo"),
- array("5;$base/foo", "5;$base/foo", "$base/foo"),
- array("5;0600;$base/foo", "5;0600;$base/foo", "$base/foo"),
- );
+ return [
+ ["$base/foo", "$base/foo", "$base/foo"],
+ ["5;$base/foo", "5;$base/foo", "$base/foo"],
+ ["5;0600;$base/foo", "5;0600;$base/foo", "$base/foo"],
+ ];
}
/**
@@ -69,7 +69,7 @@ class NativeFileSessionHandlerTest extends TestCase
public function testConstructDefault()
{
$path = ini_get('session.save_path');
- $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler());
+ $storage = new NativeSessionStorage(['name' => 'TESTING'], new NativeFileSessionHandler());
$this->assertEquals($path, ini_get('session.save_path'));
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
index 9a2212b8b4..0d246e1aa5 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
@@ -54,6 +54,6 @@ class NullSessionHandlerTest extends TestCase
public function getStorage()
{
- return new NativeSessionStorage(array(), new NullSessionHandler());
+ return new NativeSessionStorage([], new NullSessionHandler());
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
index 0edda00aa9..8aa84cff81 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
@@ -64,7 +64,7 @@ class PdoSessionHandlerTest extends TestCase
*/
public function testInexistentTable()
{
- $storage = new PdoSessionHandler($this->getMemorySqlitePdo(), array('db_table' => 'inexistent_table'));
+ $storage = new PdoSessionHandler($this->getMemorySqlitePdo(), ['db_table' => 'inexistent_table']);
$storage->open('', 'sid');
$storage->read('id');
$storage->write('id', 'data');
@@ -143,7 +143,7 @@ class PdoSessionHandlerTest extends TestCase
$stream = $this->createStream($content);
$pdo->prepareResult->expects($this->once())->method('fetchAll')
- ->will($this->returnValue(array(array($stream, 42, time()))));
+ ->will($this->returnValue([[$stream, 42, time()]]));
$storage = new PdoSessionHandler($pdo);
$result = $storage->read('foo');
@@ -171,7 +171,7 @@ class PdoSessionHandlerTest extends TestCase
$selectStmt->expects($this->atLeast(2))->method('fetchAll')
->will($this->returnCallback(function () use (&$exception, $stream) {
- return $exception ? array(array($stream, 42, time())) : array();
+ return $exception ? [[$stream, 42, time()]] : [];
}));
$insertStmt->expects($this->once())->method('execute')
@@ -337,19 +337,19 @@ class PdoSessionHandlerTest extends TestCase
public function provideUrlDsnPairs()
{
- yield array('mysql://localhost/test', 'mysql:host=localhost;dbname=test;');
- yield array('mysql://localhost:56/test', 'mysql:host=localhost;port=56;dbname=test;');
- yield array('mysql2://root:pwd@localhost/test', 'mysql:host=localhost;dbname=test;', 'root', 'pwd');
- yield array('postgres://localhost/test', 'pgsql:host=localhost;dbname=test;');
- yield array('postgresql://localhost:5634/test', 'pgsql:host=localhost;port=5634;dbname=test;');
- yield array('postgres://root:pwd@localhost/test', 'pgsql:host=localhost;dbname=test;', 'root', 'pwd');
- yield 'sqlite relative path' => array('sqlite://localhost/tmp/test', 'sqlite:tmp/test');
- yield 'sqlite absolute path' => array('sqlite://localhost//tmp/test', 'sqlite:/tmp/test');
- yield 'sqlite relative path without host' => array('sqlite:///tmp/test', 'sqlite:tmp/test');
- yield 'sqlite absolute path without host' => array('sqlite3:////tmp/test', 'sqlite:/tmp/test');
- yield array('sqlite://localhost/:memory:', 'sqlite::memory:');
- yield array('mssql://localhost/test', 'sqlsrv:server=localhost;Database=test');
- yield array('mssql://localhost:56/test', 'sqlsrv:server=localhost,56;Database=test');
+ yield ['mysql://localhost/test', 'mysql:host=localhost;dbname=test;'];
+ yield ['mysql://localhost:56/test', 'mysql:host=localhost;port=56;dbname=test;'];
+ yield ['mysql2://root:pwd@localhost/test', 'mysql:host=localhost;dbname=test;', 'root', 'pwd'];
+ yield ['postgres://localhost/test', 'pgsql:host=localhost;dbname=test;'];
+ yield ['postgresql://localhost:5634/test', 'pgsql:host=localhost;port=5634;dbname=test;'];
+ yield ['postgres://root:pwd@localhost/test', 'pgsql:host=localhost;dbname=test;', 'root', 'pwd'];
+ yield 'sqlite relative path' => ['sqlite://localhost/tmp/test', 'sqlite:tmp/test'];
+ yield 'sqlite absolute path' => ['sqlite://localhost//tmp/test', 'sqlite:/tmp/test'];
+ yield 'sqlite relative path without host' => ['sqlite:///tmp/test', 'sqlite:tmp/test'];
+ yield 'sqlite absolute path without host' => ['sqlite3:////tmp/test', 'sqlite:/tmp/test'];
+ yield ['sqlite://localhost/:memory:', 'sqlite::memory:'];
+ yield ['mssql://localhost/test', 'sqlsrv:server=localhost;Database=test'];
+ yield ['mssql://localhost:56/test', 'sqlsrv:server=localhost,56;Database=test'];
}
private function createStream($content)
@@ -387,7 +387,7 @@ class MockPdo extends \PDO
return parent::getAttribute($attribute);
}
- public function prepare($statement, $driverOptions = array())
+ public function prepare($statement, $driverOptions = [])
{
return \is_callable($this->prepareResult)
? ($this->prepareResult)($statement, $driverOptions)
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php
index 458100101c..622b42da1a 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisClusterSessionHandlerTest.php
@@ -17,6 +17,6 @@ class PredisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCas
{
protected function createRedisClient(string $host): Client
{
- return new Client(array(array('host' => $host)));
+ return new Client([['host' => $host]]);
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisSessionHandlerTest.php
index a9db4eb1bf..5ecab116f7 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PredisSessionHandlerTest.php
@@ -17,6 +17,6 @@ class PredisSessionHandlerTest extends AbstractRedisSessionHandlerTestCase
{
protected function createRedisClient(string $host): Client
{
- return new Client(array('host' => $host));
+ return new Client(['host' => $host]);
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/RedisArraySessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/RedisArraySessionHandlerTest.php
index d263e18ff7..b03a37236f 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/RedisArraySessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/RedisArraySessionHandlerTest.php
@@ -15,6 +15,6 @@ class RedisArraySessionHandlerTest extends AbstractRedisSessionHandlerTestCase
{
protected function createRedisClient(string $host): \RedisArray
{
- return new \RedisArray(array($host));
+ return new \RedisArray([$host]);
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
index b02c41ae89..6a0d16876e 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
@@ -84,7 +84,7 @@ class StrictSessionHandlerTest extends TestCase
{
$handler = $this->getMockBuilder('SessionHandlerInterface')->getMock();
$handler->expects($this->exactly(2))->method('read')
- ->withConsecutive(array('id1'), array('id2'))
+ ->withConsecutive(['id1'], ['id2'])
->will($this->onConsecutiveCalls('data1', 'data2'));
$proxy = new StrictSessionHandler($handler);
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php
index 69cf6163c1..2c4758b913 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php
@@ -26,26 +26,26 @@ class MetadataBagTest extends TestCase
*/
protected $bag;
- protected $array = array();
+ protected $array = [];
protected function setUp()
{
parent::setUp();
$this->bag = new MetadataBag();
- $this->array = array(MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 0);
+ $this->array = [MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 0];
$this->bag->initialize($this->array);
}
protected function tearDown()
{
- $this->array = array();
+ $this->array = [];
$this->bag = null;
parent::tearDown();
}
public function testInitialize()
{
- $sessionMetadata = array();
+ $sessionMetadata = [];
$bag1 = new MetadataBag();
$bag1->initialize($sessionMetadata);
@@ -82,7 +82,7 @@ class MetadataBagTest extends TestCase
public function testGetLifetime()
{
$bag = new MetadataBag();
- $array = array(MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 1000);
+ $array = [MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 1000];
$bag->initialize($array);
$this->assertEquals(1000, $bag->getLifetime());
}
@@ -111,11 +111,11 @@ class MetadataBagTest extends TestCase
$timeStamp = time();
$created = $timeStamp - 15;
- $sessionMetadata = array(
+ $sessionMetadata = [
MetadataBag::CREATED => $created,
MetadataBag::UPDATED => $created,
MetadataBag::LIFETIME => 1000,
- );
+ ];
$bag->initialize($sessionMetadata);
$this->assertEquals($created, $sessionMetadata[MetadataBag::UPDATED]);
@@ -127,11 +127,11 @@ class MetadataBagTest extends TestCase
$timeStamp = time();
$created = $timeStamp - 45;
- $sessionMetadata = array(
+ $sessionMetadata = [
MetadataBag::CREATED => $created,
MetadataBag::UPDATED => $created,
MetadataBag::LIFETIME => 1000,
- );
+ ];
$bag->initialize($sessionMetadata);
$this->assertEquals($timeStamp, $sessionMetadata[MetadataBag::UPDATED]);
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php
index 893e120ce1..2e3024ef1b 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php
@@ -45,10 +45,10 @@ class MockArraySessionStorageTest extends TestCase
$this->attributes = new AttributeBag();
$this->flashes = new FlashBag();
- $this->data = array(
- $this->attributes->getStorageKey() => array('foo' => 'bar'),
- $this->flashes->getStorageKey() => array('notice' => 'hello'),
- );
+ $this->data = [
+ $this->attributes->getStorageKey() => ['foo' => 'bar'],
+ $this->flashes->getStorageKey() => ['notice' => 'hello'],
+ ];
$this->storage = new MockArraySessionStorage();
$this->storage->registerBag($this->flashes);
@@ -80,14 +80,14 @@ class MockArraySessionStorageTest extends TestCase
$id = $this->storage->getId();
$this->storage->regenerate();
$this->assertNotEquals($id, $this->storage->getId());
- $this->assertEquals(array('foo' => 'bar'), $this->storage->getBag('attributes')->all());
- $this->assertEquals(array('notice' => 'hello'), $this->storage->getBag('flashes')->peekAll());
+ $this->assertEquals(['foo' => 'bar'], $this->storage->getBag('attributes')->all());
+ $this->assertEquals(['notice' => 'hello'], $this->storage->getBag('flashes')->peekAll());
$id = $this->storage->getId();
$this->storage->regenerate(true);
$this->assertNotEquals($id, $this->storage->getId());
- $this->assertEquals(array('foo' => 'bar'), $this->storage->getBag('attributes')->all());
- $this->assertEquals(array('notice' => 'hello'), $this->storage->getBag('flashes')->peekAll());
+ $this->assertEquals(['foo' => 'bar'], $this->storage->getBag('attributes')->all());
+ $this->assertEquals(['notice' => 'hello'], $this->storage->getBag('flashes')->peekAll());
}
public function testGetId()
@@ -101,8 +101,8 @@ class MockArraySessionStorageTest extends TestCase
{
$this->storage->clear();
- $this->assertSame(array(), $this->storage->getBag('attributes')->all());
- $this->assertSame(array(), $this->storage->getBag('flashes')->peekAll());
+ $this->assertSame([], $this->storage->getBag('attributes')->all());
+ $this->assertSame([], $this->storage->getBag('flashes')->peekAll());
}
public function testClearStartsSession()
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
index f8394d8cab..062769e282 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
@@ -91,7 +91,7 @@ class MockFileSessionStorageTest extends TestCase
$storage->start();
$this->assertEquals('108', $storage->getBag('attributes')->get('new'));
$this->assertTrue($storage->getBag('flashes')->has('newkey'));
- $this->assertEquals(array('test'), $storage->getBag('flashes')->peek('newkey'));
+ $this->assertEquals(['test'], $storage->getBag('flashes')->peek('newkey'));
}
public function testMultipleInstances()
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
index 8ce703b34e..d97973e2eb 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
@@ -56,7 +56,7 @@ class NativeSessionStorageTest extends TestCase
/**
* @return NativeSessionStorage
*/
- protected function getStorage(array $options = array())
+ protected function getStorage(array $options = [])
{
$storage = new NativeSessionStorage($options);
$storage->registerBag(new AttributeBag());
@@ -157,19 +157,19 @@ class NativeSessionStorageTest extends TestCase
{
$this->iniSet('session.cache_limiter', 'nocache');
- $storage = new NativeSessionStorage(array('cache_limiter' => 'public'));
+ $storage = new NativeSessionStorage(['cache_limiter' => 'public']);
$this->assertEquals('public', ini_get('session.cache_limiter'));
}
public function testCookieOptions()
{
- $options = array(
+ $options = [
'cookie_lifetime' => 123456,
'cookie_path' => '/my/cookie/path',
'cookie_domain' => 'symfony.example.com',
'cookie_secure' => true,
'cookie_httponly' => false,
- );
+ ];
if (\PHP_VERSION_ID >= 70300) {
$options['cookie_samesite'] = 'lax';
@@ -177,7 +177,7 @@ class NativeSessionStorageTest extends TestCase
$this->getStorage($options);
$temp = session_get_cookie_params();
- $gco = array();
+ $gco = [];
foreach ($temp as $key => $value) {
$gco['cookie_'.$key] = $value;
@@ -192,10 +192,10 @@ class NativeSessionStorageTest extends TestCase
$this->markTestSkipped('HHVM is not handled in this test case.');
}
- $options = array(
+ $options = [
'url_rewriter.tags' => 'a=href',
'cache_expire' => '200',
- );
+ ];
$this->getStorage($options);
@@ -276,9 +276,9 @@ class NativeSessionStorageTest extends TestCase
public function testSetSessionOptionsOnceSessionStartedIsIgnored()
{
session_start();
- $this->getStorage(array(
+ $this->getStorage([
'name' => 'something-else',
- ));
+ ]);
// Assert no exception has been thrown by `getStorage()`
$this->addToAssertionCount(1);
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
index a5a8561465..4332400246 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
@@ -86,10 +86,10 @@ class PhpBridgeSessionStorageTest extends TestCase
$_SESSION['drak'] = 'loves symfony';
$storage->getBag('attributes')->set('symfony', 'greatness');
$key = $storage->getBag('attributes')->getStorageKey();
- $this->assertEquals($_SESSION[$key], array('symfony' => 'greatness'));
+ $this->assertEquals($_SESSION[$key], ['symfony' => 'greatness']);
$this->assertEquals($_SESSION['drak'], 'loves symfony');
$storage->clear();
- $this->assertEquals($_SESSION[$key], array());
+ $this->assertEquals($_SESSION[$key], []);
$this->assertEquals($_SESSION['drak'], 'loves symfony');
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php
index 0b48250e01..0459a8ce97 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php
@@ -127,7 +127,7 @@ class SessionHandlerProxyTest extends TestCase
*/
public function testValidateId()
{
- $mock = $this->getMockBuilder(array('SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'))->getMock();
+ $mock = $this->getMockBuilder(['SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'])->getMock();
$mock->expects($this->once())
->method('validateId');
@@ -142,7 +142,7 @@ class SessionHandlerProxyTest extends TestCase
*/
public function testUpdateTimestamp()
{
- $mock = $this->getMockBuilder(array('SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'))->getMock();
+ $mock = $this->getMockBuilder(['SessionHandlerInterface', 'SessionUpdateTimestampHandlerInterface'])->getMock();
$mock->expects($this->once())
->method('updateTimestamp');
diff --git a/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php b/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php
index 699222e379..62dfc9bc94 100644
--- a/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php
@@ -19,7 +19,7 @@ class StreamedResponseTest extends TestCase
{
public function testConstructor()
{
- $response = new StreamedResponse(function () { echo 'foo'; }, 404, array('Content-Type' => 'text/plain'));
+ $response = new StreamedResponse(function () { echo 'foo'; }, 404, ['Content-Type' => 'text/plain']);
$this->assertEquals(404, $response->getStatusCode());
$this->assertEquals('text/plain', $response->headers->get('Content-Type'));
@@ -51,7 +51,7 @@ class StreamedResponseTest extends TestCase
public function testPrepareWithHeadRequest()
{
- $response = new StreamedResponse(function () { echo 'foo'; }, 200, array('Content-Length' => '123'));
+ $response = new StreamedResponse(function () { echo 'foo'; }, 200, ['Content-Length' => '123']);
$request = Request::create('/', 'HEAD');
$response->prepare($request);
@@ -61,7 +61,7 @@ class StreamedResponseTest extends TestCase
public function testPrepareWithCacheHeaders()
{
- $response = new StreamedResponse(function () { echo 'foo'; }, 200, array('Cache-Control' => 'max-age=600, public'));
+ $response = new StreamedResponse(function () { echo 'foo'; }, 200, ['Cache-Control' => 'max-age=600, public']);
$request = Request::create('/', 'GET');
$response->prepare($request);