Completed
Push — master ( 646e95...28cd62 )
by Derek
02:00
created
app/config/app_constants.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,29 +2,29 @@
 block discarded – undo
2 2
 /**
3 3
  * @const DILMUN_BASE_DIR The base directory at which Dilmun resides
4 4
  */
5
-define('DILMUN_BASE_DIR', dirname(dirname(dirname(__FILE__))) . "/");
5
+define('DILMUN_BASE_DIR', dirname(dirname(dirname(__FILE__)))."/");
6 6
 
7 7
 /**
8 8
  * @const DILMUN_SOURCE_DIR The source directory
9 9
  */
10
-define('DILMUN_SOURCE_DIR', DILMUN_BASE_DIR . "src/");
10
+define('DILMUN_SOURCE_DIR', DILMUN_BASE_DIR."src/");
11 11
 
12 12
 /**
13 13
  * @const DILMUN_VENDOR_DIR The vendor directory
14 14
  */
15
-define('DILMUN_VENDOR_DIR', DILMUN_BASE_DIR . "vendor/");
15
+define('DILMUN_VENDOR_DIR', DILMUN_BASE_DIR."vendor/");
16 16
 
17 17
 /**
18 18
  * @const DILMUN_LOGS_DIR The log directory
19 19
  */
20
-define('DILMUN_LOGS_DIR', DILMUN_BASE_DIR . "app/logs/");
20
+define('DILMUN_LOGS_DIR', DILMUN_BASE_DIR."app/logs/");
21 21
 
22 22
 /**
23 23
  * @const DILMUN_CONFIG_DIR The configurations directory
24 24
  */
25
-define('DILMUN_CONFIG_DIR', DILMUN_BASE_DIR . "app/config/");
25
+define('DILMUN_CONFIG_DIR', DILMUN_BASE_DIR."app/config/");
26 26
 
27 27
 /**
28 28
  * @const DILMUN_TEST_DIR The tests directory
29 29
  */
30
-define('DILMUN_TEST_DIR', DILMUN_BASE_DIR . "tests/");
30
+define('DILMUN_TEST_DIR', DILMUN_BASE_DIR."tests/");
Please login to merge, or discard this patch.
src/Nabu/LoggerHandler/File.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $full_file = "";
177 177
 
178 178
         if (isset($this->file_path)) {
179
-            $full_file = $this->file_path . DIRECTORY_SEPARATOR;
179
+            $full_file = $this->file_path.DIRECTORY_SEPARATOR;
180 180
         }
181 181
 
182 182
         $full_file .= $this->file_name;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
             if ($locked) {
232 232
                 $now = date('Y-m-d H:i:s');
233
-                $this->file_pointer->fwrite("$now : $message" . "\r\n");
233
+                $this->file_pointer->fwrite("$now : $message"."\r\n");
234 234
                 $this->file_pointer->flock(LOCK_UN);
235 235
 
236 236
                 return true;
Please login to merge, or discard this patch.
src/Nabu/StaticLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@
 block discarded – undo
218 218
         $replace = array();
219 219
 
220 220
         foreach ($context as $key => $value) {
221
-            $templated           = "{" . $key . "}";
221
+            $templated           = "{".$key."}";
222 222
             $replace[$templated] = $value;
223 223
         }
224 224
 
Please login to merge, or discard this patch.
app/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
  */
5 5
 
6 6
 require "config/app_constants.php";
7
-require DILMUN_VENDOR_DIR . "autoload.php";
8
-require DILMUN_SOURCE_DIR . "Nabu/Autoloader.php";
7
+require DILMUN_VENDOR_DIR."autoload.php";
8
+require DILMUN_SOURCE_DIR."Nabu/Autoloader.php";
9 9
 
10 10
 /**
11 11
  * @todo Pull this out somehow so that logging on bootstrap is more abstract
Please login to merge, or discard this patch.
src/Nabu/Autoloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        spl_autoload_register(array($this,"includeClass"));
26
+        spl_autoload_register(array($this, "includeClass"));
27 27
     }
28 28
 
29 29
     /**
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
         $this->updateLog("info", "Preparing package {$package} for registration with path {$path}.");
42 42
 
43 43
         $package = trim($package, "\\");
44
-        $package = $package . "\\";
44
+        $package = $package."\\";
45 45
 
46 46
         $path = rtrim($path, DIRECTORY_SEPARATOR);
47
-        $path = $path . "/";
47
+        $path = $path."/";
48 48
 
49 49
         $path_registered = $this->registrationExists($package, $path);
50 50
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $package_stack = array();
83 83
 
84 84
         foreach ($class_bits as $bit) {
85
-            $package = $package . $bit . "\\";
85
+            $package = $package.$bit."\\";
86 86
 
87 87
             $package_registered = $this->packageRegistered($package);
88 88
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         foreach ($this->packages[$package_name] as $path) {
142 142
             $converted_class = str_replace('\\', DIRECTORY_SEPARATOR, $class_name);
143
-            $class_path      = $path . $converted_class . ".php";
143
+            $class_path      = $path.$converted_class.".php";
144 144
 
145 145
             $this->updateLog("debug", "Class file path is {$class_path}");
146 146
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $package_loaded = $this->loadPackage($package, $class_path);
115 115
 
116 116
             if ($package_loaded) {
117
-                $this->updateLog("info", "Loaded {$class_path} using package {$package}");
117
+                $this->updateLog("info", "loaded {$class_path} using package {$package}");
118 118
                 return true;
119 119
             }
120 120
         }
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
         $package_registered = array_key_exists($package, $this->packages);
164 164
 
165 165
         if ($package_registered) {
166
-            $this->updateLog("info", "Package {$package} is registered");
166
+            $this->updateLog("info", "package {$package} is registered");
167 167
         } else {
168
-            $this->updateLog("info", "Package {$package} is not registered");
168
+            $this->updateLog("info", "package {$package} is not registered");
169 169
         }
170 170
 
171 171
         return $package_registered;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             if ($path_registered !== false) {
191 191
                 $path_registered = true;
192 192
 
193
-                $this->updateLog("info", "Path {$path} already registered for package {$package}");
193
+                $this->updateLog("info", "path {$path} already registered for package {$package}");
194 194
             }
195 195
         } else {
196 196
             $path_registered = false;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     private function requireFile($path)
211 211
     {
212 212
         if (file_exists($path)) {
213
-            $this->updateLog("debug", "File {$path} exists; requiring file");
213
+            $this->updateLog("debug", "file {$path} exists; requiring file");
214 214
 
215 215
             /** @noinspection PhpIncludeInspection */
216 216
             require $path;
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
             return true;
221 221
         } else {
222
-            $this->updateLog("debug", "File {$path} does not exist");
222
+            $this->updateLog("debug", "file {$path} does not exist");
223 223
 
224 224
             return false;
225 225
         }
Please login to merge, or discard this patch.
src/Kishar/Page.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         } else {
33 33
             $this->contents = false;
34 34
             
35
-            $this->updateLog("alert", "File {$contents} not found");
35
+            $this->updateLog("alert", "file {$contents} not found");
36 36
         }
37 37
 
38 38
         return $contents_exist;
Please login to merge, or discard this patch.
src/Anshar/Http/Request.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
      * Checks if a header exists by the given case-insensitive name.
107 107
      *
108 108
      * @param string $name Case-insensitive header field name.
109
-     * @return bool Returns true if any header names match the given header
109
+     * @return boolean|null Returns true if any header names match the given header
110 110
      *     name using a case-insensitive string comparison. Returns false if
111 111
      *     no matching header name is found in the message.
112 112
      */
Please login to merge, or discard this patch.
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.