@@ -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 | * The request body or post data |
| 61 | 60 | * @var array<string, mixed> |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | * Create new instance |
| 97 | 96 | * @param ServerRequestInterface $request |
| 98 | 97 | */ |
| 99 | - public function __construct(ServerRequestInterface $request) |
|
| 100 | - { |
|
| 98 | + public function __construct(ServerRequestInterface $request) { |
|
| 101 | 99 | $this->posts = (array) $request->getParsedBody(); |
| 102 | 100 | $this->gets = $request->getQueryParams(); |
| 103 | 101 | $this->servers = $request->getServerParams(); |
@@ -169,8 +167,7 @@ discard block |
||
| 169 | 167 | * |
| 170 | 168 | * @return mixed |
| 171 | 169 | */ |
| 172 | - public function get(string $key, $default = null) |
|
| 173 | - { |
|
| 170 | + public function get(string $key, $default = null) { |
|
| 174 | 171 | $gets = $this->applyInputClean($this->gets); |
| 175 | 172 | return Arr::get($gets, $key, $default); |
| 176 | 173 | } |
@@ -182,8 +179,7 @@ discard block |
||
| 182 | 179 | * |
| 183 | 180 | * @return mixed |
| 184 | 181 | */ |
| 185 | - public function post(string $key, $default = null) |
|
| 186 | - { |
|
| 182 | + public function post(string $key, $default = null) { |
|
| 187 | 183 | $posts = $this->applyInputClean($this->posts); |
| 188 | 184 | return Arr::get($posts, $key, $default); |
| 189 | 185 | } |
@@ -195,8 +191,7 @@ discard block |
||
| 195 | 191 | * |
| 196 | 192 | * @return mixed |
| 197 | 193 | */ |
| 198 | - public function server(string $key, $default = null) |
|
| 199 | - { |
|
| 194 | + public function server(string $key, $default = null) { |
|
| 200 | 195 | $servers = $this->applyInputClean($this->servers); |
| 201 | 196 | return Arr::get($servers, $key, $default); |
| 202 | 197 | } |
@@ -208,8 +203,7 @@ discard block |
||
| 208 | 203 | * |
| 209 | 204 | * @return mixed |
| 210 | 205 | */ |
| 211 | - public function cookie(string $key, $default = null) |
|
| 212 | - { |
|
| 206 | + public function cookie(string $key, $default = null) { |
|
| 213 | 207 | $cookies = $this->applyInputClean($this->cookies); |
| 214 | 208 | return Arr::get($cookies, $key, $default); |
| 215 | 209 | } |
@@ -220,8 +214,7 @@ discard block |
||
| 220 | 214 | * |
| 221 | 215 | * @return mixed |
| 222 | 216 | */ |
| 223 | - public function file(string $key) |
|
| 224 | - { |
|
| 217 | + public function file(string $key) { |
|
| 225 | 218 | $files = $this->files; |
| 226 | 219 | return Arr::get($files, $key, null); |
| 227 | 220 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class InputClean |
| 54 | 54 | * @package Platine\Framework\Http |
| 55 | 55 | */ |
| 56 | -class InputClean |
|
| 57 | -{ |
|
| 56 | +class InputClean { |
|
| 58 | 57 | /** |
| 59 | 58 | * The list of invalid filename chars |
| 60 | 59 | * @var array<string> |
@@ -127,8 +126,7 @@ discard block |
||
| 127 | 126 | * Create new instance |
| 128 | 127 | * @param string $charset |
| 129 | 128 | */ |
| 130 | - public function __construct(string $charset = 'UTF-8') |
|
| 131 | - { |
|
| 129 | + public function __construct(string $charset = 'UTF-8') { |
|
| 132 | 130 | $this->charset = $charset; |
| 133 | 131 | } |
| 134 | 132 | |
@@ -138,8 +136,7 @@ discard block |
||
| 138 | 136 | * @param bool $isImage |
| 139 | 137 | * @return mixed |
| 140 | 138 | */ |
| 141 | - public function clean($str, bool $isImage = false) |
|
| 142 | - { |
|
| 139 | + public function clean($str, bool $isImage = false) { |
|
| 143 | 140 | if (is_array($str)) { |
| 144 | 141 | foreach ($str as $key => &$value) { |
| 145 | 142 | $str[$key] = $this->clean($value); |