@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * |
| 45 | 45 | */ |
| 46 | - public function getID():?int{ |
|
| 46 | + public function getID(): ?int{ |
|
| 47 | 47 | return $this->id; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * |
| 84 | 84 | */ |
| 85 | - public function handleResponse():?RequestInterface{ |
|
| 85 | + public function handleResponse(): ?RequestInterface{ |
|
| 86 | 86 | $info = curl_getinfo($this->curl); |
| 87 | 87 | |
| 88 | 88 | return $this->multiResponseHandler->handleResponse( |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | use Psr\Http\Message\{StreamInterface, UploadedFileInterface}; |
| 15 | 15 | use InvalidArgumentException, RuntimeException; |
| 16 | 16 | |
| 17 | -use function in_array, is_file, is_string, is_writable, move_uploaded_file, php_sapi_name,rename; |
|
| 17 | +use function in_array, is_file, is_string, is_writable, move_uploaded_file, php_sapi_name, rename; |
|
| 18 | 18 | |
| 19 | 19 | use const UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_INI_SIZE, |
| 20 | 20 | UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_OK, UPLOAD_ERR_PARTIAL; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * @inheritDoc |
| 134 | 134 | */ |
| 135 | - public function getSize():?int{ |
|
| 135 | + public function getSize(): ?int{ |
|
| 136 | 136 | return $this->size; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -146,14 +146,14 @@ discard block |
||
| 146 | 146 | /** |
| 147 | 147 | * @inheritDoc |
| 148 | 148 | */ |
| 149 | - public function getClientFilename():?string{ |
|
| 149 | + public function getClientFilename(): ?string{ |
|
| 150 | 150 | return $this->clientFilename; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * @inheritDoc |
| 155 | 155 | */ |
| 156 | - public function getClientMediaType():?string{ |
|
| 156 | + public function getClientMediaType(): ?string{ |
|
| 157 | 157 | return $this->clientMediaType; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | class FactoryHelpers{ |
| 22 | 22 | |
| 23 | 23 | public const STREAM_MODES_READ_WRITE = [ |
| 24 | - 'a+', 'c+', 'c+b', 'c+t', 'r+' , 'r+b', 'r+t', 'w+' , 'w+b', 'w+t', 'x+' , 'x+b', 'x+t' |
|
| 24 | + 'a+', 'c+', 'c+b', 'c+t', 'r+', 'r+b', 'r+t', 'w+', 'w+b', 'w+t', 'x+', 'x+b', 'x+t' |
|
| 25 | 25 | ]; |
| 26 | 26 | public const STREAM_MODES_READ = [...self::STREAM_MODES_READ_WRITE, 'r', 'rb', 'rt']; |
| 27 | 27 | public const STREAM_MODES_WRITE = [...self::STREAM_MODES_READ_WRITE, 'a', 'rw', 'w', 'wb']; |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | /** |
| 118 | 118 | * @inheritDoc |
| 119 | 119 | */ |
| 120 | - public function getSize():?int{ |
|
| 120 | + public function getSize(): ?int{ |
|
| 121 | 121 | |
| 122 | 122 | if(!is_resource($this->stream)){ |
| 123 | 123 | return null; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | /** |
| 261 | 261 | * @throws \InvalidArgumentException |
| 262 | 262 | */ |
| 263 | - protected function filterPort(mixed $port):?int{ |
|
| 263 | + protected function filterPort(mixed $port): ?int{ |
|
| 264 | 264 | |
| 265 | 265 | if($port === null){ |
| 266 | 266 | return null; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | /** |
| 279 | 279 | * @inheritDoc |
| 280 | 280 | */ |
| 281 | - public function getPort():?int{ |
|
| 281 | + public function getPort(): ?int{ |
|
| 282 | 282 | return $this->port; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | /** @noinspection RegExpRedundantEscape, RegExpUnnecessaryNonCapturingGroup */ |
| 449 | 449 | return preg_replace_callback( |
| 450 | 450 | '/(?:[^a-z\d_\-\.~!\$&\'\(\)\*\+,;=%:@\/'.($query ? '\?' : '').']++|%(?![a-f\d]{2}))/i', |
| 451 | - fn(array $match):string => rawurlencode($match[0]), |
|
| 451 | + fn(array $match) : string => rawurlencode($match[0]), |
|
| 452 | 452 | $str |
| 453 | 453 | ); |
| 454 | 454 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | /** |
| 138 | 138 | * @codeCoverageIgnore |
| 139 | 139 | */ |
| 140 | - public function getCurlResource():?CH{ |
|
| 140 | + public function getCurlResource(): ?CH{ |
|
| 141 | 141 | return $this->curl; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | CURLOPT_URL => (string)$this->request->getUri()->withFragment(''), |
| 177 | 177 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2TLS, |
| 178 | 178 | CURLOPT_USERAGENT => $this->options->user_agent, |
| 179 | - CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS, |
|
| 179 | + CURLOPT_PROTOCOLS => CURLPROTO_HTTP|CURLPROTO_HTTPS, |
|
| 180 | 180 | CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS, |
| 181 | 181 | CURLOPT_TIMEOUT => $this->options->timeout, |
| 182 | 182 | CURLOPT_CONNECTTIMEOUT => 30, |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | /** |
| 340 | 340 | * |
| 341 | 341 | */ |
| 342 | - public function init():?CH{ |
|
| 342 | + public function init(): ?CH{ |
|
| 343 | 343 | $options = $this->initCurlOptions(); |
| 344 | 344 | |
| 345 | 345 | if(!isset($options[CURLOPT_HEADERFUNCTION])){ |
@@ -35,6 +35,6 @@ |
||
| 35 | 35 | RequestInterface $request, |
| 36 | 36 | int $id, |
| 37 | 37 | array $curl_info |
| 38 | - ):?RequestInterface; |
|
| 38 | + ): ?RequestInterface; |
|
| 39 | 39 | |
| 40 | 40 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | /** |
| 65 | 65 | * extract the given URL and return the last valid location header |
| 66 | 66 | */ |
| 67 | - public function extract(UriInterface|string $shortURL):?string{ |
|
| 67 | + public function extract(UriInterface|string $shortURL): ?string{ |
|
| 68 | 68 | $request = $this->requestFactory->createRequest('GET', $shortURL); |
| 69 | 69 | $response = $this->sendRequest($request); |
| 70 | 70 | |