Passed
Push — master ( 32692a...12a81e )
by Sebastian
02:54
created
src/URLInfo.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $port = $this->getInfoKey('port');
202 202
         
203
-        if(!empty($port)) {
203
+        if (!empty($port)) {
204 204
             return (int)$port;
205 205
         }
206 206
         
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     
281 281
     protected function getInfoKey(string $name) : string
282 282
     {
283
-        if(isset($this->info[$name])) {
283
+        if (isset($this->info[$name])) {
284 284
             return (string)$this->info[$name];
285 285
         }
286 286
         
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 
290 290
     public function getNormalized() : string
291 291
     {
292
-        if(!$this->isValid()) {
292
+        if (!$this->isValid()) {
293 293
             return '';
294 294
         }
295 295
         
296
-        if(!isset($this->normalizer)) {
296
+        if (!isset($this->normalizer)) {
297 297
             $this->normalizer = new URLInfo_Normalizer($this);
298 298
         }
299 299
         
@@ -302,11 +302,11 @@  discard block
 block discarded – undo
302 302
     
303 303
     public function getNormalizedWithoutAuth() : string
304 304
     {
305
-        if(!$this->isValid()) {
305
+        if (!$this->isValid()) {
306 306
             return '';
307 307
         }
308 308
         
309
-        if(!isset($this->normalizer)) {
309
+        if (!isset($this->normalizer)) {
310 310
             $this->normalizer = new URLInfo_Normalizer($this);
311 311
             $this->normalizer->disableAuth();
312 312
         }
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     */
336 336
     public function getHighlighted() : string
337 337
     {
338
-        if(!$this->isValid()) {
338
+        if (!$this->isValid()) {
339 339
             return '';
340 340
         }
341 341
         
@@ -377,14 +377,14 @@  discard block
 block discarded – undo
377 377
     */
378 378
     public function getParams() : array
379 379
     {
380
-        if(!$this->paramExclusion || empty($this->excludedParams)) {
380
+        if (!$this->paramExclusion || empty($this->excludedParams)) {
381 381
             return $this->info['params'];
382 382
         }
383 383
         
384 384
         $keep = array();
385
-        foreach($this->info['params'] as $name => $value) 
385
+        foreach ($this->info['params'] as $name => $value) 
386 386
         {
387
-            if(!isset($this->excludedParams[$name])) {
387
+            if (!isset($this->excludedParams[$name])) {
388 388
                 $keep[$name] = $value;
389 389
             }
390 390
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     */
411 411
     public function getParam(string $name) : string
412 412
     {
413
-        if(isset($this->info['params'][$name])) {
413
+        if (isset($this->info['params'][$name])) {
414 414
             return $this->info['params'][$name];
415 415
         }
416 416
         
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     */
430 430
     public function excludeParam(string $name, string $reason) : URLInfo
431 431
     {
432
-        if(!isset($this->excludedParams[$name]))
432
+        if (!isset($this->excludedParams[$name]))
433 433
         {
434 434
             $this->excludedParams[$name] = $reason;
435 435
             $this->setParamExclusion();
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
     
456 456
     public function getTypeLabel() : string
457 457
     {
458
-        if(!isset(self::$typeLabels))
458
+        if (!isset(self::$typeLabels))
459 459
         {
460 460
             self::$typeLabels = array(
461 461
                 self::TYPE_EMAIL => t('Email'),
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         
468 468
         $type = $this->getType();
469 469
         
470
-        if(!isset(self::$typeLabels[$type]))
470
+        if (!isset(self::$typeLabels[$type]))
471 471
         {
472 472
             throw new BaseException(
473 473
                 sprintf('Unknown URL type label for type [%s].', $type),
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
     * @param bool $highlight
488 488
     * @return URLInfo
489 489
     */
490
-    public function setHighlightExcluded(bool $highlight=true) : URLInfo
490
+    public function setHighlightExcluded(bool $highlight = true) : URLInfo
491 491
     {
492 492
         $this->highlightExcluded = $highlight;
493 493
         return $this;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
      * @see URLInfo::isParamExclusionEnabled()
536 536
      * @see URLInfo::setHighlightExcluded()
537 537
      */
538
-    public function setParamExclusion(bool $enabled=true) : URLInfo
538
+    public function setParamExclusion(bool $enabled = true) : URLInfo
539 539
     {
540 540
         $this->paramExclusion = $enabled;
541 541
         return $this;
@@ -561,13 +561,13 @@  discard block
 block discarded – undo
561 561
     */
562 562
     public function containsExcludedParams() : bool
563 563
     {
564
-        if(empty($this->excludedParams)) {
564
+        if (empty($this->excludedParams)) {
565 565
             return false;
566 566
         }
567 567
         
568 568
         $names = array_keys($this->info['params']);
569
-        foreach($names as $name) {
570
-            if(isset($this->excludedParams[$name])) {
569
+        foreach ($names as $name) {
570
+            if (isset($this->excludedParams[$name])) {
571 571
                 return true;
572 572
             }
573 573
         }
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 
584 584
     public function offsetSet($offset, $value) 
585 585
     {
586
-        if(in_array($offset, $this->infoKeys)) {
586
+        if (in_array($offset, $this->infoKeys)) {
587 587
             $this->info[$offset] = $value;
588 588
         }
589 589
     }
@@ -600,11 +600,11 @@  discard block
 block discarded – undo
600 600
     
601 601
     public function offsetGet($offset) 
602 602
     {
603
-        if($offset === 'port') {
603
+        if ($offset === 'port') {
604 604
             return $this->getPort();
605 605
         }
606 606
         
607
-        if(in_array($offset, $this->infoKeys)) {
607
+        if (in_array($offset, $this->infoKeys)) {
608 608
             return $this->getInfoKey($offset);
609 609
         }
610 610
         
@@ -636,12 +636,12 @@  discard block
 block discarded – undo
636 636
     * @return bool
637 637
     * @throws BaseException
638 638
     */
639
-    public function tryConnect(bool $verifySSL=true) : bool
639
+    public function tryConnect(bool $verifySSL = true) : bool
640 640
     {
641 641
         requireCURL();
642 642
         
643 643
         $ch = curl_init();
644
-        if($ch === false)
644
+        if ($ch === false)
645 645
         {
646 646
             throw new BaseException(
647 647
                 'Could not initialize a new cURL instance.',
@@ -657,13 +657,13 @@  discard block
 block discarded – undo
657 657
         curl_setopt($ch, CURLOPT_TIMEOUT, 10);
658 658
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
659 659
         
660
-        if(!$verifySSL) 
660
+        if (!$verifySSL) 
661 661
         {
662 662
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
663 663
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
664 664
         }
665 665
         
666
-        if($this->hasUsername()) 
666
+        if ($this->hasUsername()) 
667 667
         {
668 668
             curl_setopt($ch, CURLOPT_USERNAME, $this->getUsername());
669 669
             curl_setopt($ch, CURLOPT_PASSWORD, $this->getPassword());
Please login to merge, or discard this patch.
src/URLInfo/Normalizer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,26 +64,26 @@
 block discarded – undo
64 64
     {
65 65
         $normalized = $this->info->getScheme().'://';
66 66
         
67
-        if($this->info->hasUsername() && $this->auth) {
67
+        if ($this->info->hasUsername() && $this->auth) {
68 68
             $normalized .= urlencode($this->info->getUsername()).':'.urlencode($this->info->getPassword()).'@';
69 69
         }
70 70
         
71 71
         $normalized .= $this->info->getHost();
72 72
         
73
-        if($this->info->hasPort()) {
73
+        if ($this->info->hasPort()) {
74 74
             $normalized .= ':'.$this->info->getPort();
75 75
         }
76 76
         
77
-        if($this->info->hasPath()) {
77
+        if ($this->info->hasPath()) {
78 78
             $normalized .= $this->info->getPath();
79 79
         }
80 80
         
81 81
         $params = $this->info->getParams();
82
-        if(!empty($params)) {
82
+        if (!empty($params)) {
83 83
             $normalized .= '?'.http_build_query($params);
84 84
         }
85 85
         
86
-        if($this->info->hasFragment()) {
86
+        if ($this->info->hasFragment()) {
87 87
             $normalized .= '#'.$this->info->getFragment();
88 88
         }
89 89
         
Please login to merge, or discard this patch.
src/RequestHelper/Response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
     
143 143
     protected function getInfoKey(string $name) : string
144 144
     {
145
-        if(isset($this->info[$name])) {
145
+        if (isset($this->info[$name])) {
146 146
             return (string)$this->info[$name];
147 147
         }
148 148
         
Please login to merge, or discard this patch.
src/RequestHelper/Boundaries/Boundary.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $lines[] = '--'.$this->boundaries->getMimeBoundary();
92 92
         $lines[] = $this->renderContentDisposition();
93 93
         
94
-        if(!empty($this->contentType)) {
94
+        if (!empty($this->contentType)) {
95 95
             $lines[] = $this->renderContentType();
96 96
         }
97 97
         
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $result = 'Content-Disposition: form-data';
107 107
         
108
-        foreach($this->dispositionParams as $name => $value) 
108
+        foreach ($this->dispositionParams as $name => $value) 
109 109
         {
110
-            $result .= '; '.$name.'="' . $value . '"';
110
+            $result .= '; '.$name.'="'.$value.'"';
111 111
         }   
112 112
         
113 113
         return $result;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
     
116 116
     protected function renderContentType() : string
117 117
     {
118
-        $result = 'Content-Type: ' . $this->contentType; 
118
+        $result = 'Content-Type: '.$this->contentType; 
119 119
         
120
-        if(!empty($this->contentEncoding)) 
120
+        if (!empty($this->contentEncoding)) 
121 121
         {
122
-            $result .= '; charset=' . $this->contentEncoding;
122
+            $result .= '; charset='.$this->contentEncoding;
123 123
         }
124 124
         
125 125
         return $result;
Please login to merge, or discard this patch.
src/RequestHelper/Boundaries.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,13 +123,13 @@
 block discarded – undo
123 123
     {
124 124
         $result = '';
125 125
         
126
-        foreach($this->boundaries as $boundary)
126
+        foreach ($this->boundaries as $boundary)
127 127
         {
128 128
             $result .= $boundary->render();
129 129
         }
130 130
         
131
-        $result .= "--" . $this->getMimeBoundary() . "--" . 
132
-        $this->getEOL() . $this->getEOL(); // always finish with two eol's!!
131
+        $result .= "--".$this->getMimeBoundary()."--". 
132
+        $this->getEOL().$this->getEOL(); // always finish with two eol's!!
133 133
         
134 134
         return $result;
135 135
     }
Please login to merge, or discard this patch.
src/RequestHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         // CURL will complain about an empty response when the 
211 211
         // server sends a 100-continue code. That should not be
212 212
         // regarded as an error.
213
-        if($output === false && $this->response->getCode() !== 100)
213
+        if ($output === false && $this->response->getCode() !== 100)
214 214
         {
215 215
             $this->response->setError(
216 216
                 curl_errno($ch),
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     protected function createCURL(URLInfo $url)
244 244
     {
245 245
         $ch = curl_init();
246
-        if($ch === false)
246
+        if ($ch === false)
247 247
         {
248 248
             throw new RequestHelper_Exception(
249 249
                 'Could not initialize a new cURL instance.',
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         }
254 254
 
255 255
         $this->setHeader('Content-Length', $this->boundaries->getContentLength());
256
-        $this->setHeader('Content-Type', 'multipart/form-data; charset=UTF-8; boundary=' . $this->mimeBoundary);
256
+        $this->setHeader('Content-Type', 'multipart/form-data; charset=UTF-8; boundary='.$this->mimeBoundary);
257 257
         
258 258
         //curl_setopt($ch, CURLOPT_VERBOSE, true);
259 259
         curl_setopt($ch, CURLOPT_POST, true);
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
265 265
         curl_setopt($ch, CURLOPT_HTTPHEADER, $this->renderHeaders());
266 266
         
267
-        if($this->verifySSL)
267
+        if ($this->verifySSL)
268 268
         {
269 269
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
270 270
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
271 271
         }
272 272
         
273
-        if($url->hasUsername())
273
+        if ($url->hasUsername())
274 274
         {
275 275
             curl_setopt($ch, CURLOPT_USERNAME, $url->getUsername());
276 276
             curl_setopt($ch, CURLOPT_PASSWORD, $url->getPassword());
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     {
284 284
         $result = array();
285 285
         
286
-        foreach($this->headers as $name => $value) {
286
+        foreach ($this->headers as $name => $value) {
287 287
             $result[] = $name.': '.$value;
288 288
         }
289 289
         
Please login to merge, or discard this patch.