Passed
Push — master ( 7e7628...15770c )
by Petr
02:33
created
php-src/Protocols/Http/Answer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
     public function getHeader(string $key, ?string $default = null): ?string
173 173
     {
174
-        return isset($this->headers[$key])? strval(reset($this->headers[$key])) : $default;
174
+        return isset($this->headers[$key]) ? strval(reset($this->headers[$key])) : $default;
175 175
     }
176 176
 
177 177
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public function getHeaders(string $key): array
182 182
     {
183
-        return isset($this->headers[$key])? $this->headers[$key] : [];
183
+        return isset($this->headers[$key]) ? $this->headers[$key] : [];
184 184
     }
185 185
 
186 186
     /**
Please login to merge, or discard this patch.
php-src/Protocols/Http/Query.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function addValues($array): self
151 151
     {
152
-        array_walk($array, function ($value, $key) {
152
+        array_walk($array, function($value, $key) {
153 153
             $this->addValue($key, $value);
154 154
         });
155 155
         return $this;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
     protected function prepareBoundary(): self
229 229
     {
230
-        $this->boundary = $this->isMultipart() ? $this->generateBoundary() : null ;
230
+        $this->boundary = $this->isMultipart() ? $this->generateBoundary() : null;
231 231
         return $this;
232 232
     }
233 233
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     protected function getQueryHeaders(): string
349 349
     {
350
-        return implode(Http::DELIMITER, array_map(function ($key, $value) {
350
+        return implode(Http::DELIMITER, array_map(function($key, $value) {
351 351
             return sprintf('%s: %s', $key, $value);
352 352
         }, array_keys($this->headers), array_values($this->headers)));
353 353
     }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     {
370 370
         $requestPart = '';
371 371
         if ($this->isInline() && !empty($this->content)) {
372
-            $requestPart .= (false === mb_strpos($this->path, '?')) ? '?' : '&' ;
372
+            $requestPart .= (false === mb_strpos($this->path, '?')) ? '?' : '&';
373 373
             $requestPart .= $this->getSimpleRequest();
374 374
         }
375 375
         return $this->path . $requestPart;
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      */
382 382
     protected function getSimpleRequest(): string
383 383
     {
384
-        return implode('&', array_map(function ($key, Http\Query\Value $value) {
384
+        return implode('&', array_map(function($key, Http\Query\Value $value) {
385 385
             return sprintf('%s=%s', urlencode($key), urlencode($value->getContent()));
386 386
         }, array_keys($this->content), array_values($this->content)));
387 387
     }
Please login to merge, or discard this patch.
php-src/Helper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         if (false === $parsedLink) {
115 115
             throw new RequestException(static::$lang->rrHelpInvalidLink($this->link));
116 116
         }
117
-        $schema = !empty($parsedLink["scheme"]) ? strtolower($parsedLink["scheme"]) : '' ;
117
+        $schema = !empty($parsedLink["scheme"]) ? strtolower($parsedLink["scheme"]) : '';
118 118
         $libSchema = $this->getLibSchema($schema, $parsedLink);
119 119
         $libQuery = $this->getLibRequest($schema, $parsedLink, $libSchema);
120 120
         return $this->getLibResponseProcessor($schema)->setResponse(
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 $query->maxLength = is_null($this->connectionParams['maxLength']) ? null : intval($this->connectionParams['maxLength']);
225 225
                 return $query
226 226
                     ->setRequestSettings($settings)
227
-                    ->setPath($parsed['path'] . (!empty($parsed['query']) ? '?' . $parsed['query'] : '' ))
227
+                    ->setPath($parsed['path'] . (!empty($parsed['query']) ? '?' . $parsed['query'] : ''))
228 228
                     ->setMethod($this->getMethod())
229 229
                     ->setInline(boolval($this->connectionParams['multipart']))
230 230
                     ->addValues(empty($this->postContent) ? [] : (array) $this->postContent)
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     protected function getMethod(): string
238 238
     {
239 239
         $method = strtoupper(strval($this->connectionParams['method']));
240
-        return (in_array($method, ['GET', 'POST', 'PUT', 'DELETE'])) ? $method : 'GET' ;
240
+        return (in_array($method, ['GET', 'POST', 'PUT', 'DELETE'])) ? $method : 'GET';
241 241
     }
242 242
 
243 243
     /**
Please login to merge, or discard this patch.
examples/udp/client.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 echo "Socket created \n";
22 22
 
23 23
 //Communication loop
24
-while(1)
24
+while (1)
25 25
 {
26 26
     //Take some input to send
27 27
     echo 'Enter a message to send : ';
28 28
     $input = fgets(STDIN);
29 29
 
30 30
     //Send the message to the server
31
-    if ( ! socket_sendto($sock, $input , strlen($input) , 0 , $server , $port)) {
31
+    if (!socket_sendto($sock, $input, strlen($input), 0, $server, $port)) {
32 32
         $errorcode = socket_last_error();
33 33
         $errormsg = socket_strerror($errorcode);
34 34
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
     //Now receive reply from server and print it
39
-    if (false === socket_recv ( $sock , $reply , 2045 , MSG_WAITALL )) {
39
+    if (false === socket_recv($sock, $reply, 2045, MSG_WAITALL)) {
40 40
         $errorcode = socket_last_error();
41 41
         $errormsg = socket_strerror($errorcode);
42 42
 
Please login to merge, or discard this patch.
php-src/Sockets/Stream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 //        ];
52 52
 
53 53
         $context = stream_context_create($this->contextOptions);
54
-        $link = $protocolWrapper->getHostname() . (!empty($protocolWrapper->getPort()) ? ':' . $protocolWrapper->getPort() : '' );
54
+        $link = $protocolWrapper->getHostname() . (!empty($protocolWrapper->getPort()) ? ':' . $protocolWrapper->getPort() : '');
55 55
         $timeout = is_null($protocolWrapper->getTimeout()) ? 10.0 : floatval($protocolWrapper->getTimeout()); // do NOT ask - php7 + phpstan
56 56
         $filePointer = stream_socket_client($link, $errno, $errStr, $timeout, STREAM_CLIENT_CONNECT, $context);
57 57
 
Please login to merge, or discard this patch.
php-src/Schemas/ASchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     public function getHost(): string
52 52
     {
53 53
         $host = '' . $this->host;
54
-        return (preg_match('#^[0-9a-f:]+$#', $host) ? '[' . $host . ']' : $host ); // IPv6
54
+        return (preg_match('#^[0-9a-f:]+$#', $host) ? '[' . $host . ']' : $host); // IPv6
55 55
     }
56 56
 
57 57
     public function getPort(): ?int
Please login to merge, or discard this patch.