@@ -136,7 +136,7 @@ |
||
| 136 | 136 | : (!empty($meta['seekable']) |
| 137 | 137 | ? $meta['seekable'] |
| 138 | 138 | : false |
| 139 | - ); |
|
| 139 | + ); |
|
| 140 | 140 | |
| 141 | 141 | if (isset($options['writable']) && is_bool($options['writable'])) { |
| 142 | 142 | $this->writable = $options['writable']; |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | use InvalidArgumentException; |
| 52 | 52 | use RuntimeException; |
| 53 | 53 | |
| 54 | -class Stream implements StreamInterface |
|
| 55 | -{ |
|
| 54 | +class Stream implements StreamInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * The writable stream modes. |
| 58 | 57 | */ |
@@ -99,8 +98,7 @@ discard block |
||
| 99 | 98 | * @param string $mode the stream mode |
| 100 | 99 | * @param array<string, mixed> $options the stream options |
| 101 | 100 | */ |
| 102 | - public function __construct($content = '', string $mode = 'r+', array $options = []) |
|
| 103 | - { |
|
| 101 | + public function __construct($content = '', string $mode = 'r+', array $options = []) { |
|
| 104 | 102 | if (is_string($content)) { |
| 105 | 103 | if (is_file($content) || strpos($content, 'php://') === 0) { |
| 106 | 104 | $mode = $this->filterMode($mode); |
@@ -193,8 +191,7 @@ discard block |
||
| 193 | 191 | /** |
| 194 | 192 | * {@inheritdoc} |
| 195 | 193 | */ |
| 196 | - public function detach() |
|
| 197 | - { |
|
| 194 | + public function detach() { |
|
| 198 | 195 | $resource = $this->resource; |
| 199 | 196 | if ($resource !== null) { |
| 200 | 197 | $this->resource = null; |
@@ -361,8 +358,7 @@ discard block |
||
| 361 | 358 | /** |
| 362 | 359 | * {@inheritdoc} |
| 363 | 360 | */ |
| 364 | - public function getMetadata(string $key = null) |
|
| 365 | - { |
|
| 361 | + public function getMetadata(string $key = null) { |
|
| 366 | 362 | if ($this->resource === null) { |
| 367 | 363 | throw new RuntimeException('Stream resource is detached'); |
| 368 | 364 | } |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * a wrapper around the most common operations, including serialization of |
| 55 | 55 | * the entire stream to a string. |
| 56 | 56 | */ |
| 57 | -interface StreamInterface |
|
| 58 | -{ |
|
| 57 | +interface StreamInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * Reads all data from the stream into a string, from the beginning to end. |
| 61 | 60 | * |
@@ -49,8 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | use InvalidArgumentException; |
| 51 | 51 | |
| 52 | -class Response extends Message implements ResponseInterface |
|
| 53 | -{ |
|
| 52 | +class Response extends Message implements ResponseInterface { |
|
| 54 | 53 | /** |
| 55 | 54 | * The reason phrases. |
| 56 | 55 | */ |
@@ -150,8 +149,7 @@ discard block |
||
| 150 | 149 | * @param int $statusCode |
| 151 | 150 | * @param string $reasonPhrase |
| 152 | 151 | */ |
| 153 | - public function __construct(int $statusCode = 200, string $reasonPhrase = '') |
|
| 154 | - { |
|
| 152 | + public function __construct(int $statusCode = 200, string $reasonPhrase = '') { |
|
| 155 | 153 | $this->statusCode = $this->filterStatusCode($statusCode); |
| 156 | 154 | if ($reasonPhrase === '') { |
| 157 | 155 | $reasonPhrase = isset(static::REASON_PHRASES[$this->statusCode]) |
@@ -87,8 +87,7 @@ |
||
| 87 | 87 | * be implemented such that they retain the internal state of the current |
| 88 | 88 | * message and return an instance that contains the changed state. |
| 89 | 89 | */ |
| 90 | -interface ServerRequestInterface extends RequestInterface |
|
| 91 | -{ |
|
| 90 | +interface ServerRequestInterface extends RequestInterface { |
|
| 92 | 91 | /** |
| 93 | 92 | * Retrieve server parameters. |
| 94 | 93 | * |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * be implemented such that they retain the internal state of the current |
| 69 | 69 | * message and return an instance that contains the changed state. |
| 70 | 70 | */ |
| 71 | -interface RequestInterface extends MessageInterface |
|
| 72 | -{ |
|
| 71 | +interface RequestInterface extends MessageInterface { |
|
| 73 | 72 | /** |
| 74 | 73 | * Retrieves the message's request target. |
| 75 | 74 | * |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | * @see http://www.ietf.org/rfc/rfc7230.txt |
| 62 | 62 | * @see http://www.ietf.org/rfc/rfc7231.txt |
| 63 | 63 | */ |
| 64 | -interface MessageInterface |
|
| 65 | -{ |
|
| 64 | +interface MessageInterface { |
|
| 66 | 65 | /** |
| 67 | 66 | * Retrieves the HTTP protocol version as a string. |
| 68 | 67 | * |
@@ -62,8 +62,7 @@ |
||
| 62 | 62 | * be implemented such that they retain the internal state of the current |
| 63 | 63 | * message and return an instance that contains the changed state. |
| 64 | 64 | */ |
| 65 | -interface ResponseInterface extends MessageInterface |
|
| 66 | -{ |
|
| 65 | +interface ResponseInterface extends MessageInterface { |
|
| 67 | 66 | /** |
| 68 | 67 | * Gets the response status code. |
| 69 | 68 | * |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | namespace Platine\Http; |
| 49 | 49 | |
| 50 | -class Uri implements UriInterface |
|
| 51 | -{ |
|
| 50 | +class Uri implements UriInterface { |
|
| 52 | 51 | /** |
| 53 | 52 | * The Uri scheme |
| 54 | 53 | * @var string |
@@ -95,8 +94,7 @@ discard block |
||
| 95 | 94 | * Create new Uri instance |
| 96 | 95 | * @param string $uri |
| 97 | 96 | */ |
| 98 | - public function __construct(string $uri = '') |
|
| 99 | - { |
|
| 97 | + public function __construct(string $uri = '') { |
|
| 100 | 98 | if ($uri !== '') { |
| 101 | 99 | $parts = parse_url($uri); |
| 102 | 100 | |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | } |
| 509 | 509 | return (string) preg_replace_callback( |
| 510 | 510 | '/(?:[^a-zA-Z0-9\-._~!$&\'()*+,;=:@\/%]++|%(?![a-fA-F0-9]{2}))/', |
| 511 | - function ($matches) { |
|
| 511 | + function($matches) { |
|
| 512 | 512 | return rawurlencode($matches[0]); |
| 513 | 513 | }, |
| 514 | 514 | $path |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | } |
| 539 | 539 | return (string) preg_replace_callback( |
| 540 | 540 | '/(?:[^a-zA-Z0-9\-._~!$&\'()*+,;=:@\/?%]++|%(?![a-fA-F0-9]{2}))/', |
| 541 | - function ($matches) { |
|
| 541 | + function($matches) { |
|
| 542 | 542 | return rawurlencode($matches[0]); |
| 543 | 543 | }, |
| 544 | 544 | $query |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | if ($fragment !== '') { |
| 559 | 559 | return (string) preg_replace_callback( |
| 560 | 560 | '/(?:[^a-zA-Z0-9\-._~!$&\'()*+,;=:@\/?%]++|%(?![a-fA-F0-9]{2}))/', |
| 561 | - function ($matches) { |
|
| 561 | + function($matches) { |
|
| 562 | 562 | return rawurlencode($matches[0]); |
| 563 | 563 | }, |
| 564 | 564 | $fragment |
@@ -124,9 +124,9 @@ |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | - * Create uploaded file from global variable $_FILES |
|
| 128 | - * @return array<mixed> |
|
| 129 | - */ |
|
| 127 | + * Create uploaded file from global variable $_FILES |
|
| 128 | + * @return array<mixed> |
|
| 129 | + */ |
|
| 130 | 130 | public static function createFromGlobals(): array |
| 131 | 131 | { |
| 132 | 132 | return static::normalize($_FILES); |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | use InvalidArgumentException; |
| 51 | 51 | use RuntimeException; |
| 52 | 52 | |
| 53 | -class UploadedFile implements UploadedFileInterface |
|
| 54 | -{ |
|
| 53 | +class UploadedFile implements UploadedFileInterface { |
|
| 55 | 54 | /** |
| 56 | 55 | * The uploaded file name |
| 57 | 56 | * @var string |