diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /lib/public/AppFramework | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/AppFramework')
-rw-r--r-- | lib/public/AppFramework/Controller.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/Entity.php | 6 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/DataResponse.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/JSONResponse.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Response.php | 8 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Template/PublicTemplateResponse.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/TemplateResponse.php | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index 6642c332d52..f9d53bf1129 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -77,7 +77,7 @@ abstract class Controller { $this->request = $request; // default responders - $this->responders = array( + $this->responders = [ 'json' => function ($data) { if ($data instanceof DataResponse) { $response = new JSONResponse( @@ -95,7 +95,7 @@ abstract class Controller { } return new JSONResponse($data); } - ); + ]; } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 287c991b587..7340df55fc4 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -38,8 +38,8 @@ abstract class Entity { public $id; - private $_updatedFields = array(); - private $_fieldTypes = array('id' => 'integer'); + private $_updatedFields = []; + private $_fieldTypes = ['id' => 'integer']; /** @@ -95,7 +95,7 @@ abstract class Entity { * @since 7.0.0 */ public function resetUpdatedFields(){ - $this->_updatedFields = array(); + $this->_updatedFields = []; } /** diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php index d6068f9c515..29c042def7c 100644 --- a/lib/public/AppFramework/Http/DataResponse.php +++ b/lib/public/AppFramework/Http/DataResponse.php @@ -51,8 +51,8 @@ class DataResponse extends Response { * @param array $headers additional key value based headers * @since 8.0.0 */ - public function __construct($data=array(), $statusCode=Http::STATUS_OK, - array $headers=array()) { + public function __construct($data=[], $statusCode=Http::STATUS_OK, + array $headers=[]) { parent::__construct(); $this->data = $data; diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php index abe01904887..e84042dbe19 100644 --- a/lib/public/AppFramework/Http/JSONResponse.php +++ b/lib/public/AppFramework/Http/JSONResponse.php @@ -53,7 +53,7 @@ class JSONResponse extends Response { * @param int $statusCode the Http status code, defaults to 200 * @since 6.0.0 */ - public function __construct($data=array(), $statusCode=Http::STATUS_OK) { + public function __construct($data=[], $statusCode=Http::STATUS_OK) { parent::__construct(); $this->data = $data; diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 15318f30bbd..2fc985aabfb 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -49,16 +49,16 @@ class Response { * Headers - defaults to ['Cache-Control' => 'no-cache, no-store, must-revalidate'] * @var array */ - private $headers = array( + private $headers = [ 'Cache-Control' => 'no-cache, no-store, must-revalidate' - ); + ]; /** * Cookies that will be need to be constructed as header * @var array */ - private $cookies = array(); + private $cookies = []; /** @@ -138,7 +138,7 @@ class Response { * @since 8.0.0 */ public function addCookie($name, $value, \DateTime $expireDate = null) { - $this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate); + $this->cookies[$name] = ['value' => $value, 'expireDate' => $expireDate]; return $this; } diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php index d6d1fc1d72a..801c0a2347c 100644 --- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php +++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php @@ -48,7 +48,7 @@ class PublicTemplateResponse extends TemplateResponse { * @param array $params * @since 14.0.0 */ - public function __construct(string $appName, string $templateName, array $params = array()) { + public function __construct(string $appName, string $templateName, array $params = []) { parent::__construct($appName, $templateName, $params, 'public'); \OC_Util::addScript('core', 'public/publicpage'); } diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index 8ceeed5b8aa..fb02c9d265c 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -75,7 +75,7 @@ class TemplateResponse extends Response { * @param string $renderAs how the page should be rendered, defaults to user * @since 6.0.0 - parameters $params and $renderAs were added in 7.0.0 */ - public function __construct($appName, $templateName, array $params=array(), + public function __construct($appName, $templateName, array $params=[], $renderAs='user') { parent::__construct(); |