Completed
Push — master ( 646e95...28cd62 )
by Derek
02:00
created
src/Anshar/Http/Uri.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -404,6 +404,9 @@  discard block
 block discarded – undo
404 404
         // TODO: Implement __toString() method.
405 405
     }
406 406
 
407
+    /**
408
+     * @param string $uri
409
+     */
407 410
     private function explodeUri($uri)
408 411
     {
409 412
         $part_labels            = array(
@@ -454,6 +457,9 @@  discard block
 block discarded – undo
454 457
         return $parts;
455 458
     }
456 459
 
460
+    /**
461
+     * @param string|null $hier_part
462
+     */
457 463
     private function explodeHierParts($hier_part)
458 464
     {
459 465
         $authority_parts    = array();
@@ -480,6 +486,9 @@  discard block
 block discarded – undo
480 486
         return $hier_parts;
481 487
     }
482 488
 
489
+    /**
490
+     * @param string $authority
491
+     */
483 492
     private function explodeAuthority($authority)
484 493
     {
485 494
         $authority_parts    = array();
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
     private function explodeUri($uri)
408 408
     {
409
-        $part_labels            = array(
409
+        $part_labels = array(
410 410
             "scheme",
411 411
             "hier_part",
412 412
             "authority",
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         );
420 420
 
421 421
         $reg_start              = '/^';
422
-        $scheme_part            = '(?P<scheme>.+?)';    //Laziness since a URI may contain several colons;
422
+        $scheme_part            = '(?P<scheme>.+?)'; //Laziness since a URI may contain several colons;
423 423
                                                         //TODO: Refactor to remove laziness
424 424
         $scheme_separator       = ':';
425 425
         $hier_part              = '(?<hier_part>.[^\?#]+)';
@@ -427,12 +427,12 @@  discard block
 block discarded – undo
427 427
         $fragment_part          = '(?:#(?P<fragment>.+))?';
428 428
         $reg_end                = '/';
429 429
 
430
-        $uri_syntax             =   $reg_start .
431
-                                    $scheme_part .
432
-                                    $scheme_separator .
433
-                                    $hier_part .
434
-                                    $query_part .
435
-                                    $fragment_part .
430
+        $uri_syntax             = $reg_start.
431
+                                    $scheme_part.
432
+                                    $scheme_separator.
433
+                                    $hier_part.
434
+                                    $query_part.
435
+                                    $fragment_part.
436 436
                                     $reg_end;
437 437
 
438 438
         $uri_valid = preg_match($uri_syntax, $uri, $parts);
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
         $path_part          = '(?P<path>.+)';
465 465
         $reg_end            = '/';
466 466
 
467
-        $hier_part_syntax   =   $reg_start .
468
-                                $authority_part .
469
-                                $path_part .
467
+        $hier_part_syntax   = $reg_start.
468
+                                $authority_part.
469
+                                $path_part.
470 470
                                 $reg_end;
471 471
 
472
-        $match              = preg_match($hier_part_syntax, $hier_part, $hier_parts);
472
+        $match = preg_match($hier_part_syntax, $hier_part, $hier_parts);
473 473
 
474 474
         if (isset($hier_parts["authority"])) {
475
-            $authority_parts    = $this->explodeAuthority($hier_parts["authority"]);
475
+            $authority_parts = $this->explodeAuthority($hier_parts["authority"]);
476 476
         }
477 477
 
478
-        $hier_parts         = array_merge($hier_parts, $authority_parts);
478
+        $hier_parts = array_merge($hier_parts, $authority_parts);
479 479
 
480 480
         return $hier_parts;
481 481
     }
@@ -490,13 +490,13 @@  discard block
 block discarded – undo
490 490
         $port_part          = '(?::(?P<port>[0-9]+))?';
491 491
         $reg_end            = '/';
492 492
 
493
-        $authority_syntax   =   $reg_start .
494
-                                $user_info_part .
495
-                                $host_part .
496
-                                $port_part .
493
+        $authority_syntax   = $reg_start.
494
+                                $user_info_part.
495
+                                $host_part.
496
+                                $port_part.
497 497
                                 $reg_end;
498 498
 
499
-        $has_authority      = preg_match($authority_syntax, $authority, $authority_parts);
499
+        $has_authority = preg_match($authority_syntax, $authority, $authority_parts);
500 500
 
501 501
         if (isset($authority_parts["port"])) {
502 502
             $authority_parts["port"] = (int) $authority_parts["port"];
Please login to merge, or discard this patch.