diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 13:53:40 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 13:54:22 +0200 |
commit | afbd9c4e6ed834e713039f2cff88ba3eec03dadb (patch) | |
tree | 7d8721cf8fc0329d6b750db63798de67a162b090 /lib/public/AppFramework | |
parent | 19e97e86c69ab128191439d6a17dacb5a630cf98 (diff) | |
download | nextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.tar.gz nextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.zip |
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/AppFramework')
-rw-r--r-- | lib/public/AppFramework/ApiController.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/DoesNotExistException.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/Entity.php | 16 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/Mapper.php | 16 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/MultipleObjectsReturnedException.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/QBMapper.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/DataDisplayResponse.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/DataResponse.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/JSONResponse.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/StreamResponse.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Template/PublicTemplateResponse.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/TemplateResponse.php | 12 | ||||
-rw-r--r-- | lib/public/AppFramework/Middleware.php | 8 | ||||
-rw-r--r-- | lib/public/AppFramework/OCSController.php | 2 |
14 files changed, 40 insertions, 40 deletions
diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php index e8ecf61c921..feae56fc2c0 100644 --- a/lib/public/AppFramework/ApiController.php +++ b/lib/public/AppFramework/ApiController.php @@ -61,7 +61,7 @@ abstract class ApiController extends Controller { IRequest $request, $corsMethods='PUT, POST, GET, DELETE, PATCH', $corsAllowedHeaders='Authorization, Content-Type, Accept', - $corsMaxAge=1728000){ + $corsMaxAge=1728000) { parent::__construct($appName, $request); $this->corsMethods = $corsMethods; $this->corsAllowedHeaders = $corsAllowedHeaders; diff --git a/lib/public/AppFramework/Db/DoesNotExistException.php b/lib/public/AppFramework/Db/DoesNotExistException.php index d401bcb5f8b..36cab24db76 100644 --- a/lib/public/AppFramework/Db/DoesNotExistException.php +++ b/lib/public/AppFramework/Db/DoesNotExistException.php @@ -39,7 +39,7 @@ class DoesNotExistException extends \Exception implements IMapperException { * @param string $msg the error message * @since 7.0.0 */ - public function __construct($msg){ + public function __construct($msg) { parent::__construct($msg); } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 3735c83cf81..6221f96b375 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -65,7 +65,7 @@ abstract class Entity { * @param array $row the row to map onto the entity * @since 7.0.0 */ - public static function fromRow(array $row){ + public static function fromRow(array $row) { $instance = new static(); foreach($row as $key => $value){ @@ -93,7 +93,7 @@ abstract class Entity { * Marks the entity as clean needed for setting the id after the insertion * @since 7.0.0 */ - public function resetUpdatedFields(){ + public function resetUpdatedFields() { $this->_updatedFields = []; } @@ -175,7 +175,7 @@ abstract class Entity { * @param string $attribute the name of the attribute * @since 7.0.0 */ - protected function markFieldUpdated($attribute){ + protected function markFieldUpdated($attribute) { $this->_updatedFields[$attribute] = true; } @@ -186,7 +186,7 @@ abstract class Entity { * @return string the property name * @since 7.0.0 */ - public function columnToProperty($columnName){ + public function columnToProperty($columnName) { $parts = explode('_', $columnName); $property = null; @@ -208,7 +208,7 @@ abstract class Entity { * @return string the column name * @since 7.0.0 */ - public function propertyToColumn($property){ + public function propertyToColumn($property) { $parts = preg_split('/(?=[A-Z])/', $property); $column = null; @@ -228,7 +228,7 @@ abstract class Entity { * @return array array of updated fields for update query * @since 7.0.0 */ - public function getUpdatedFields(){ + public function getUpdatedFields() { return $this->_updatedFields; } @@ -240,7 +240,7 @@ abstract class Entity { * @param string $type the type which will be used to call settype() * @since 7.0.0 */ - protected function addType($fieldName, $type){ + protected function addType($fieldName, $type) { $this->_fieldTypes[$fieldName] = $type; } @@ -252,7 +252,7 @@ abstract class Entity { * @return string slugified value * @since 7.0.0 */ - public function slugify($attributeName){ + public function slugify($attributeName) { // toSlug should only work for existing attributes if(property_exists($this, $attributeName)){ $value = $this->$attributeName; diff --git a/lib/public/AppFramework/Db/Mapper.php b/lib/public/AppFramework/Db/Mapper.php index 7dcc4a4bade..6d35c99d672 100644 --- a/lib/public/AppFramework/Db/Mapper.php +++ b/lib/public/AppFramework/Db/Mapper.php @@ -49,7 +49,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function __construct(IDBConnection $db, $tableName, $entityClass=null){ + public function __construct(IDBConnection $db, $tableName, $entityClass=null) { $this->db = $db; $this->tableName = '*PREFIX*' . $tableName; @@ -68,7 +68,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function getTableName(){ + public function getTableName() { return $this->tableName; } @@ -80,7 +80,7 @@ abstract class Mapper { * @since 7.0.0 - return value added in 8.1.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function delete(Entity $entity){ + public function delete(Entity $entity) { $sql = 'DELETE FROM `' . $this->tableName . '` WHERE `id` = ?'; $stmt = $this->execute($sql, [$entity->getId()]); $stmt->closeCursor(); @@ -95,7 +95,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function insert(Entity $entity){ + public function insert(Entity $entity) { // get updated fields to save, fields have to be set using a setter to // be saved $properties = $entity->getUpdatedFields(); @@ -145,7 +145,7 @@ abstract class Mapper { * @since 7.0.0 - return value was added in 8.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function update(Entity $entity){ + public function update(Entity $entity) { // if entity wasn't changed it makes no sense to run a db query $properties = $entity->getUpdatedFields(); if(count($properties) === 0) { @@ -235,7 +235,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function execute($sql, array $params=[], $limit=null, $offset=null){ + protected function execute($sql, array $params=[], $limit=null, $offset=null) { $query = $this->db->prepare($sql, $limit, $offset); if ($this->isAssocArray($params)) { @@ -271,7 +271,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null){ + protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null) { $stmt = $this->execute($sql, $params, $limit, $offset); $row = $stmt->fetch(); @@ -367,7 +367,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function findEntity($sql, array $params=[], $limit=null, $offset=null){ + protected function findEntity($sql, array $params=[], $limit=null, $offset=null) { return $this->mapRowToEntity($this->findOneQuery($sql, $params, $limit, $offset)); } diff --git a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php index d5fd63bd405..a3f211194c4 100644 --- a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php +++ b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php @@ -39,7 +39,7 @@ class MultipleObjectsReturnedException extends \Exception implements IMapperExce * @param string $msg the error message * @since 7.0.0 */ - public function __construct($msg){ + public function __construct($msg) { parent::__construct($msg); } diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 487128b7305..d26fb090725 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -58,7 +58,7 @@ abstract class QBMapper { * mapped to queries without using sql * @since 14.0.0 */ - public function __construct(IDBConnection $db, string $tableName, string $entityClass=null){ + public function __construct(IDBConnection $db, string $tableName, string $entityClass=null) { $this->db = $db; $this->tableName = $tableName; diff --git a/lib/public/AppFramework/Http/DataDisplayResponse.php b/lib/public/AppFramework/Http/DataDisplayResponse.php index 4b31bc7dc0d..8e14b231522 100644 --- a/lib/public/AppFramework/Http/DataDisplayResponse.php +++ b/lib/public/AppFramework/Http/DataDisplayResponse.php @@ -73,7 +73,7 @@ class DataDisplayResponse extends Response { * @return DataDisplayResponse Reference to this object * @since 8.1.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -85,7 +85,7 @@ class DataDisplayResponse extends Response { * @return string the data * @since 8.1.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php index 7efbb58d8c7..a978df49010 100644 --- a/lib/public/AppFramework/Http/DataResponse.php +++ b/lib/public/AppFramework/Http/DataResponse.php @@ -68,7 +68,7 @@ class DataResponse extends Response { * @return DataResponse Reference to this object * @since 8.0.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -80,7 +80,7 @@ class DataResponse extends Response { * @return array the data * @since 8.0.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php index 9451ef6677e..1d7a626d5cd 100644 --- a/lib/public/AppFramework/Http/JSONResponse.php +++ b/lib/public/AppFramework/Http/JSONResponse.php @@ -86,7 +86,7 @@ class JSONResponse extends Response { * @return JSONResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -98,7 +98,7 @@ class JSONResponse extends Response { * @return array the data * @since 6.0.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/StreamResponse.php b/lib/public/AppFramework/Http/StreamResponse.php index 80985ae7527..a228ed5566c 100644 --- a/lib/public/AppFramework/Http/StreamResponse.php +++ b/lib/public/AppFramework/Http/StreamResponse.php @@ -42,7 +42,7 @@ class StreamResponse extends Response implements ICallbackResponse { * @param string|resource $filePath the path to the file or a file handle which should be streamed * @since 8.1.0 */ - public function __construct ($filePath) { + public function __construct($filePath) { parent::__construct(); $this->filePath = $filePath; @@ -55,7 +55,7 @@ class StreamResponse extends Response implements ICallbackResponse { * @param IOutput $output a small wrapper that handles output * @since 8.1.0 */ - public function callback (IOutput $output) { + public function callback(IOutput $output) { // handle caching if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) { if (!(is_resource($this->filePath) || file_exists($this->filePath))) { diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php index 9965ca6bd33..67fe6165eef 100644 --- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php +++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php @@ -98,7 +98,7 @@ class PublicTemplateResponse extends TemplateResponse { } $this->headerActions[] = $action; } - usort($this->headerActions, function(IMenuAction $a, IMenuAction $b) { + usort($this->headerActions, function (IMenuAction $a, IMenuAction $b) { return $a->getPriority() > $b->getPriority(); }); } diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index 5ce7c3a7966..504b4af93ff 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -96,7 +96,7 @@ class TemplateResponse extends Response { * @return TemplateResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function setParams(array $params){ + public function setParams(array $params) { $this->params = $params; return $this; @@ -108,7 +108,7 @@ class TemplateResponse extends Response { * @return array the params * @since 6.0.0 */ - public function getParams(){ + public function getParams() { return $this->params; } @@ -118,7 +118,7 @@ class TemplateResponse extends Response { * @return string the name of the used template * @since 6.0.0 */ - public function getTemplateName(){ + public function getTemplateName() { return $this->templateName; } @@ -132,7 +132,7 @@ class TemplateResponse extends Response { * @return TemplateResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function renderAs($renderAs){ + public function renderAs($renderAs) { $this->renderAs = $renderAs; return $this; @@ -144,7 +144,7 @@ class TemplateResponse extends Response { * @return string the renderAs value * @since 6.0.0 */ - public function getRenderAs(){ + public function getRenderAs() { return $this->renderAs; } @@ -154,7 +154,7 @@ class TemplateResponse extends Response { * @return string the rendered html * @since 6.0.0 */ - public function render(){ + public function render() { // \OCP\Template needs an empty string instead of 'blank' for an unwrapped response $renderAs = $this->renderAs === 'blank' ? '' : $this->renderAs; diff --git a/lib/public/AppFramework/Middleware.php b/lib/public/AppFramework/Middleware.php index 5df8a919efe..2cf27fc14fd 100644 --- a/lib/public/AppFramework/Middleware.php +++ b/lib/public/AppFramework/Middleware.php @@ -52,7 +52,7 @@ abstract class Middleware { * the controller * @since 6.0.0 */ - public function beforeController($controller, $methodName){ + public function beforeController($controller, $methodName) { } @@ -72,7 +72,7 @@ abstract class Middleware { * @return Response a Response object in case that the exception was handled * @since 6.0.0 */ - public function afterException($controller, $methodName, \Exception $exception){ + public function afterException($controller, $methodName, \Exception $exception) { throw $exception; } @@ -88,7 +88,7 @@ abstract class Middleware { * @return Response a Response object * @since 6.0.0 */ - public function afterController($controller, $methodName, Response $response){ + public function afterController($controller, $methodName, Response $response) { return $response; } @@ -104,7 +104,7 @@ abstract class Middleware { * @return string the output that should be printed * @since 6.0.0 */ - public function beforeOutput($controller, $methodName, $output){ + public function beforeOutput($controller, $methodName, $output) { return $output; } diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index 4a3fa882577..d7243bb4d68 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -63,7 +63,7 @@ abstract class OCSController extends ApiController { IRequest $request, $corsMethods='PUT, POST, GET, DELETE, PATCH', $corsAllowedHeaders='Authorization, Content-Type, Accept', - $corsMaxAge=1728000){ + $corsMaxAge=1728000) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); $this->registerResponder('json', function ($data) { |