@@ -79,7 +79,7 @@ |
||
| 79 | 79 | */ |
| 80 | 80 | public function addRoutes(Router $router): void |
| 81 | 81 | { |
| 82 | - $router->group('/roles', function (Router $router) { |
|
| 82 | + $router->group('/roles', function(Router $router) { |
|
| 83 | 83 | $router->get('', ListAction::class, 'role_list'); |
| 84 | 84 | $router->get('/detail/{id:i}', DetailAction::class, 'role_detail'); |
| 85 | 85 | $router->post('/batch', BatchAction::class, 'role_batch'); |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | * @class RoleServiceProvider |
| 60 | 60 | * @package Platine\Framework |
| 61 | 61 | */ |
| 62 | -class RoleServiceProvider extends ServiceProvider |
|
| 63 | -{ |
|
| 62 | +class RoleServiceProvider extends ServiceProvider { |
|
| 64 | 63 | |
| 65 | 64 | /** |
| 66 | 65 | * {@inheritdoc} |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class RequestData |
| 55 | 55 | * @package Platine\Framework\Http |
| 56 | 56 | */ |
| 57 | -class RequestData |
|
| 58 | -{ |
|
| 57 | +class RequestData { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * The request body or post data |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | * Create new instance |
| 92 | 91 | * @param ServerRequestInterface $request |
| 93 | 92 | */ |
| 94 | - public function __construct(ServerRequestInterface $request) |
|
| 95 | - { |
|
| 93 | + public function __construct(ServerRequestInterface $request) { |
|
| 96 | 94 | $this->posts = (array) $request->getParsedBody(); |
| 97 | 95 | $this->gets = $request->getQueryParams(); |
| 98 | 96 | $this->servers = $request->getServerParams(); |
@@ -154,8 +152,7 @@ discard block |
||
| 154 | 152 | * |
| 155 | 153 | * @return mixed |
| 156 | 154 | */ |
| 157 | - public function get(string $key, $default = null) |
|
| 158 | - { |
|
| 155 | + public function get(string $key, $default = null) { |
|
| 159 | 156 | $gets = $this->applyInputClean($this->gets); |
| 160 | 157 | return Arr::get($gets, $key, $default); |
| 161 | 158 | } |
@@ -167,8 +164,7 @@ discard block |
||
| 167 | 164 | * |
| 168 | 165 | * @return mixed |
| 169 | 166 | */ |
| 170 | - public function post(string $key, $default = null) |
|
| 171 | - { |
|
| 167 | + public function post(string $key, $default = null) { |
|
| 172 | 168 | $posts = $this->applyInputClean($this->posts); |
| 173 | 169 | return Arr::get($posts, $key, $default); |
| 174 | 170 | } |
@@ -180,8 +176,7 @@ discard block |
||
| 180 | 176 | * |
| 181 | 177 | * @return mixed |
| 182 | 178 | */ |
| 183 | - public function server(string $key, $default = null) |
|
| 184 | - { |
|
| 179 | + public function server(string $key, $default = null) { |
|
| 185 | 180 | $servers = $this->applyInputClean($this->servers); |
| 186 | 181 | return Arr::get($servers, $key, $default); |
| 187 | 182 | } |
@@ -193,8 +188,7 @@ discard block |
||
| 193 | 188 | * |
| 194 | 189 | * @return mixed |
| 195 | 190 | */ |
| 196 | - public function cookie(string $key, $default = null) |
|
| 197 | - { |
|
| 191 | + public function cookie(string $key, $default = null) { |
|
| 198 | 192 | $cookies = $this->applyInputClean($this->cookies); |
| 199 | 193 | return Arr::get($cookies, $key, $default); |
| 200 | 194 | } |
@@ -204,8 +198,7 @@ discard block |
||
| 204 | 198 | * @param mixed $str |
| 205 | 199 | * @return mixed |
| 206 | 200 | */ |
| 207 | - protected function cleanInput($str) |
|
| 208 | - { |
|
| 201 | + protected function cleanInput($str) { |
|
| 209 | 202 | if (is_array($str)) { |
| 210 | 203 | return array_map([$this, 'cleanInput'], $str); |
| 211 | 204 | } |