| @@ -2,29 +2,29 @@ | ||
| 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/"); | |
| @@ -218,7 +218,7 @@ | ||
| 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 | |
| @@ -23,7 +23,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | |
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | $full_file = ""; | 
| 122 | 122 | |
| 123 | 123 |          if (isset($this->file_path)) { | 
| 124 | - $full_file = $this->file_path . DIRECTORY_SEPARATOR; | |
| 124 | + $full_file = $this->file_path.DIRECTORY_SEPARATOR; | |
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 | $full_file .= $this->file_name; | 
| @@ -156,7 +156,7 @@ discard block | ||
| 156 | 156 | |
| 157 | 157 |              if ($file_writable) { | 
| 158 | 158 |                  $now = date('Y-m-d H:i:s'); | 
| 159 | -                $this->file_pointer->fwrite("$now : $message" . "\r\n"); | |
| 159 | +                $this->file_pointer->fwrite("$now : $message"."\r\n"); | |
| 160 | 160 | $this->file_pointer->flock(LOCK_UN); | 
| 161 | 161 | |
| 162 | 162 | $message_written = true; | 
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | require "config/app_constants.php"; | 
| 3 | -require DILMUN_VENDOR_DIR . "autoload.php"; | |
| 4 | -require DILMUN_SOURCE_DIR . "Nabu/Autoloader.php"; | |
| 3 | +require DILMUN_VENDOR_DIR."autoload.php"; | |
| 4 | +require DILMUN_SOURCE_DIR."Nabu/Autoloader.php"; | |
| 5 | 5 | |
| 6 | 6 | use Subreality\Dilmun\Nabu\Autoloader; | 
| 7 | 7 | use Subreality\Dilmun\Nabu\Logger; | 
| @@ -36,7 +36,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 { | 
| @@ -115,13 +115,13 @@ discard block | ||
| 115 | 115 | $normalized_authority = $this->uri_parts["host"]; | 
| 116 | 116 | |
| 117 | 117 |          if (!empty($this->uri_parts["user_info"])) { | 
| 118 | - $normalized_authority = $this->uri_parts["user_info"] . "@" . $normalized_authority; | |
| 118 | + $normalized_authority = $this->uri_parts["user_info"]."@".$normalized_authority; | |
| 119 | 119 | } | 
| 120 | 120 | |
| 121 | 121 | $normalized_port = $this->normalizePort(); | 
| 122 | 122 | |
| 123 | 123 |          if (!is_null($normalized_port)) { | 
| 124 | - $normalized_authority = $normalized_authority . ":" . $normalized_port; | |
| 124 | + $normalized_authority = $normalized_authority.":".$normalized_port; | |
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 | return $normalized_authority; | 
| @@ -213,7 +213,7 @@ discard block | ||
| 213 | 213 | public function getPath() | 
| 214 | 214 |      { | 
| 215 | 215 |          $path_unencoded = array("/"); | 
| 216 | - $allowed = implode($this->pchar_unencoded) . implode($this->sub_delims) . implode($path_unencoded); | |
| 216 | + $allowed = implode($this->pchar_unencoded).implode($this->sub_delims).implode($path_unencoded); | |
| 217 | 217 | |
| 218 | 218 |          if ($this->containsUnallowedUriCharacters($this->uri_parts["path"], $allowed)) { | 
| 219 | 219 | $encoded_string = $this->encodeComponent($this->uri_parts["path"], $path_unencoded); | 
| @@ -542,7 +542,7 @@ discard block | ||
| 542 | 542 | $fragment_part = '(?:#(?P<fragment>.*))?'; | 
| 543 | 543 | $reg_end = '/'; | 
| 544 | 544 | |
| 545 | - $uri_syntax = $reg_start . $scheme_part . $hier_part . $query_part . $fragment_part . $reg_end; | |
| 545 | + $uri_syntax = $reg_start.$scheme_part.$hier_part.$query_part.$fragment_part.$reg_end; | |
| 546 | 546 | |
| 547 | 547 | $uri_valid = preg_match($uri_syntax, $uri, $parts); | 
| 548 | 548 | |
| @@ -574,7 +574,7 @@ discard block | ||
| 574 | 574 | $path_part = '(?P<path>.+)?'; | 
| 575 | 575 | $reg_end = '/'; | 
| 576 | 576 | |
| 577 | - $hier_part_syntax = $reg_start . $authority_part . $path_part . $reg_end; | |
| 577 | + $hier_part_syntax = $reg_start.$authority_part.$path_part.$reg_end; | |
| 578 | 578 | |
| 579 | 579 | preg_match($hier_part_syntax, $hier_part, $hier_parts); | 
| 580 | 580 | |
| @@ -605,7 +605,7 @@ discard block | ||
| 605 | 605 | $port_part = '(?::(?P<port>[0-9]+))?'; | 
| 606 | 606 | $reg_end = '/'; | 
| 607 | 607 | |
| 608 | - $authority_syntax = $reg_start . $user_info_part . $host_part . $port_part . $reg_end; | |
| 608 | + $authority_syntax = $reg_start.$user_info_part.$host_part.$port_part.$reg_end; | |
| 609 | 609 | |
| 610 | 610 | preg_match($authority_syntax, $authority, $authority_parts); | 
| 611 | 611 | |
| @@ -708,7 +708,7 @@ discard block | ||
| 708 | 708 | $authority_string = ""; | 
| 709 | 709 | |
| 710 | 710 |          if (!empty($authority)) { | 
| 711 | - $authority_string .= "//" . $authority; | |
| 711 | + $authority_string .= "//".$authority; | |
| 712 | 712 | } | 
| 713 | 713 | |
| 714 | 714 | return $authority_string; | 
| @@ -735,7 +735,7 @@ discard block | ||
| 735 | 735 | $path_string .= $collapsed_slashes; | 
| 736 | 736 |          } elseif (!empty($path)) { | 
| 737 | 737 |              if (!$path_string_helper->startsWith("/")) { | 
| 738 | - $path_string .= "/" . $path; | |
| 738 | + $path_string .= "/".$path; | |
| 739 | 739 |              } else { | 
| 740 | 740 | $path_string .= $path; | 
| 741 | 741 | } | 
| @@ -758,7 +758,7 @@ discard block | ||
| 758 | 758 | $query_string = ""; | 
| 759 | 759 | |
| 760 | 760 |          if (!empty($query)) { | 
| 761 | - $query_string .= "?" . $query; | |
| 761 | + $query_string .= "?".$query; | |
| 762 | 762 | } | 
| 763 | 763 | |
| 764 | 764 | return $query_string; | 
| @@ -778,7 +778,7 @@ discard block | ||
| 778 | 778 | $fragment_string = ""; | 
| 779 | 779 | |
| 780 | 780 |          if (!empty($fragment)) { | 
| 781 | - $fragment_string .= "#" . $fragment; | |
| 781 | + $fragment_string .= "#".$fragment; | |
| 782 | 782 | } | 
| 783 | 783 | |
| 784 | 784 | return $fragment_string; | 
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | $uri_query = $this->query; | 
| 122 | 122 | |
| 123 | 123 |          if (!empty($uri_query)) { | 
| 124 | - $uri_query = "?" . $uri_query; | |
| 124 | + $uri_query = "?".$uri_query; | |
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 | return $uri_query; | 
| @@ -133,12 +133,12 @@ discard block | ||
| 133 | 133 | */ | 
| 134 | 134 | private function compileValidPattern() | 
| 135 | 135 |      { | 
| 136 | - self::$valid_pattern = '/^([\/\?' . | |
| 137 | - $this->unreserved_pattern . | |
| 138 | - $this->sub_delims_pattern . | |
| 139 | - $this->pchar_pattern . | |
| 140 | - ']|' . | |
| 141 | - $this->pct_encoded_pattern . | |
| 136 | + self::$valid_pattern = '/^([\/\?'. | |
| 137 | + $this->unreserved_pattern. | |
| 138 | + $this->sub_delims_pattern. | |
| 139 | + $this->pchar_pattern. | |
| 140 | + ']|'. | |
| 141 | + $this->pct_encoded_pattern. | |
| 142 | 142 | ')*$/'; | 
| 143 | 143 | } | 
| 144 | 144 | |