Completed
Push — master ( 2f6747...41f5f2 )
by Derek
02:12
created
src/Anshar/Utils/StringHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
      *
80 80
      * @param string $string    A string the string may or may not start with, with or without repetition
81 81
      *
82
-     * @return bool|string      Returns a potentially modified string with a repeating, starting string collapsed into
82
+     * @return string|false      Returns a potentially modified string with a repeating, starting string collapsed into
83 83
      *                          a single instance of the string
84 84
      *                          Returns false if the string does not start with any quantity of the given string
85 85
      */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function affectChunks(callable $function, ...$delimiters)
37 37
     {
38 38
         $delimiter_string = "";
39
-        $replace_callback = function ($matches) use ($function) {
39
+        $replace_callback = function($matches) use ($function) {
40 40
 
41 41
             $callback_string = $function($matches[0]);
42 42
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function startsWith($string)
66 66
     {
67
-        $pattern = "/^" . preg_quote($string, "/") . "/";
67
+        $pattern = "/^".preg_quote($string, "/")."/";
68 68
 
69 69
         $starts_with_string = preg_match($pattern, $this->string);
70 70
 
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
     public function collapseStartingRepetition($string)
87 87
     {
88 88
         $matches = array();
89
-        $pattern = "/^[" . preg_quote($string, "/") . "]+(?P<remainder>.*)/";
89
+        $pattern = "/^[".preg_quote($string, "/")."]+(?P<remainder>.*)/";
90 90
 
91 91
         $starts_with_string = preg_match($pattern, $this->string, $matches);
92 92
 
93 93
         if ($starts_with_string) {
94
-            $collapsed_string = $string . $matches["remainder"];
94
+            $collapsed_string = $string.$matches["remainder"];
95 95
 
96 96
             return $collapsed_string;
97 97
         } else {
Please login to merge, or discard this patch.
src/Anshar/Http/Uri.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
         $normalized_authority = $this->uri_parts["host"];
112 112
 
113 113
         if (!empty($this->uri_parts["user_info"])) {
114
-            $normalized_authority = $this->uri_parts["user_info"] . "@" . $normalized_authority;
114
+            $normalized_authority = $this->uri_parts["user_info"]."@".$normalized_authority;
115 115
         }
116 116
 
117 117
         $normalized_port = $this->normalizePort();
118 118
 
119 119
         if (!is_null($normalized_port)) {
120
-            $normalized_authority = $normalized_authority . ":" . $normalized_port;
120
+            $normalized_authority = $normalized_authority.":".$normalized_port;
121 121
         }
122 122
 
123 123
         return $normalized_authority;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     public function getPath()
210 210
     {
211 211
         $path_unencoded = array("/");
212
-        $allowed        = implode($this->pchar_unencoded) . implode($this->sub_delims) . implode($path_unencoded);
212
+        $allowed        = implode($this->pchar_unencoded).implode($this->sub_delims).implode($path_unencoded);
213 213
 
214 214
         if ($this->containsUnallowedUriCharacters($this->uri_parts["path"], $allowed)) {
215 215
             $encoded_string = $this->encodeComponent($this->uri_parts["path"], $path_unencoded);
@@ -505,15 +505,15 @@  discard block
 block discarded – undo
505 505
         $path_string_helper = new StringHelper($uri_parts["path"]);
506 506
 
507 507
         if (!empty($uri_parts["scheme"])) {
508
-            $uri_string .= $uri_parts["scheme"] . ":";
508
+            $uri_string .= $uri_parts["scheme"].":";
509 509
         }
510 510
 
511 511
         if (!empty($uri_parts["authority"])) {
512
-            $uri_string .= "//" . $uri_parts["authority"];
512
+            $uri_string .= "//".$uri_parts["authority"];
513 513
 
514 514
             if (!empty($uri_parts["path"])) {
515 515
                 if (!$path_string_helper->startsWith("/")) {
516
-                    $uri_string .= "/" . $uri_parts["path"];
516
+                    $uri_string .= "/".$uri_parts["path"];
517 517
                 } else {
518 518
                     $uri_string .= $uri_parts["path"];
519 519
                 }
@@ -529,11 +529,11 @@  discard block
 block discarded – undo
529 529
         }
530 530
 
531 531
         if (!empty($uri_parts["query"])) {
532
-            $uri_string .= "?" . $uri_parts["query"];
532
+            $uri_string .= "?".$uri_parts["query"];
533 533
         }
534 534
 
535 535
         if (!empty($uri_parts["fragment"])) {
536
-            $uri_string .= "#" . $uri_parts["fragment"];
536
+            $uri_string .= "#".$uri_parts["fragment"];
537 537
         }
538 538
 
539 539
         return $uri_string;
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         $fragment_part = '(?:#(?P<fragment>.*))?';
557 557
         $reg_end       = '/';
558 558
 
559
-        $uri_syntax = $reg_start . $scheme_part . $hier_part . $query_part . $fragment_part . $reg_end;
559
+        $uri_syntax = $reg_start.$scheme_part.$hier_part.$query_part.$fragment_part.$reg_end;
560 560
 
561 561
         $uri_valid = preg_match($uri_syntax, $uri, $parts);
562 562
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         $path_part      = '(?P<path>.+)?';
585 585
         $reg_end        = '/';
586 586
 
587
-        $hier_part_syntax = $reg_start . $authority_part . $path_part . $reg_end;
587
+        $hier_part_syntax = $reg_start.$authority_part.$path_part.$reg_end;
588 588
 
589 589
         preg_match($hier_part_syntax, $hier_part, $hier_parts);
590 590
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
         $port_part      = '(?::(?P<port>[0-9]+))?';
616 616
         $reg_end        = '/';
617 617
 
618
-        $authority_syntax = $reg_start . $user_info_part . $host_part . $port_part . $reg_end;
618
+        $authority_syntax = $reg_start.$user_info_part.$host_part.$port_part.$reg_end;
619 619
 
620 620
         preg_match($authority_syntax, $authority, $authority_parts);
621 621
 
Please login to merge, or discard this patch.