@@ -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 |
@@ -114,7 +114,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -32,7 +32,7 @@ |
||
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; |
@@ -106,7 +106,7 @@ |
||
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 | */ |
@@ -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 { |
@@ -111,13 +111,13 @@ discard block |
||
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 |
||
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); |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $fragment_part = '(?:#(?P<fragment>.*))?'; |
538 | 538 | $reg_end = '/'; |
539 | 539 | |
540 | - $uri_syntax = $reg_start . $scheme_part . $hier_part . $query_part . $fragment_part . $reg_end; |
|
540 | + $uri_syntax = $reg_start.$scheme_part.$hier_part.$query_part.$fragment_part.$reg_end; |
|
541 | 541 | |
542 | 542 | $uri_valid = preg_match($uri_syntax, $uri, $parts); |
543 | 543 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | $path_part = '(?P<path>.+)?'; |
566 | 566 | $reg_end = '/'; |
567 | 567 | |
568 | - $hier_part_syntax = $reg_start . $authority_part . $path_part . $reg_end; |
|
568 | + $hier_part_syntax = $reg_start.$authority_part.$path_part.$reg_end; |
|
569 | 569 | |
570 | 570 | preg_match($hier_part_syntax, $hier_part, $hier_parts); |
571 | 571 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $port_part = '(?::(?P<port>[0-9]+))?'; |
597 | 597 | $reg_end = '/'; |
598 | 598 | |
599 | - $authority_syntax = $reg_start . $user_info_part . $host_part . $port_part . $reg_end; |
|
599 | + $authority_syntax = $reg_start.$user_info_part.$host_part.$port_part.$reg_end; |
|
600 | 600 | |
601 | 601 | preg_match($authority_syntax, $authority, $authority_parts); |
602 | 602 | |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $scheme_string = ""; |
700 | 700 | |
701 | 701 | if (!empty($scheme)) { |
702 | - $scheme_string .= $scheme . ":"; |
|
702 | + $scheme_string .= $scheme.":"; |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | return $scheme_string; |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | $authority_string = ""; |
720 | 720 | |
721 | 721 | if (!empty($authority)) { |
722 | - $authority_string .= "//" . $authority; |
|
722 | + $authority_string .= "//".$authority; |
|
723 | 723 | } |
724 | 724 | |
725 | 725 | return $authority_string; |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | $path_string .= $collapsed_slashes; |
747 | 747 | } elseif (!empty($path)) { |
748 | 748 | if (!$path_string_helper->startsWith("/")) { |
749 | - $path_string .= "/" . $path; |
|
749 | + $path_string .= "/".$path; |
|
750 | 750 | } else { |
751 | 751 | $path_string .= $path; |
752 | 752 | } |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | $query_string = ""; |
770 | 770 | |
771 | 771 | if (!empty($query)) { |
772 | - $query_string .= "?" . $query; |
|
772 | + $query_string .= "?".$query; |
|
773 | 773 | } |
774 | 774 | |
775 | 775 | return $query_string; |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | $fragment_string = ""; |
790 | 790 | |
791 | 791 | if (!empty($fragment)) { |
792 | - $fragment_string .= "#" . $fragment; |
|
792 | + $fragment_string .= "#".$fragment; |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | return $fragment_string; |