@@ -143,7 +143,7 @@ |
||
143 | 143 | $seconds = (int) ($duration - $hours * 60 * 60 - $minutes * 60); |
144 | 144 | |
145 | 145 | if ($seconds <= 0) { |
146 | - return ' ms'; |
|
146 | + return ' ms'; |
|
147 | 147 | } elseif ($seconds > 0) { |
148 | 148 | return ' s'; |
149 | 149 | } |
@@ -30,61 +30,61 @@ |
||
30 | 30 | */ |
31 | 31 | class FileMimeType |
32 | 32 | { |
33 | - /** |
|
34 | - * Map of extensions to mime types. |
|
35 | - * |
|
36 | - * @var array $mimes |
|
37 | - */ |
|
38 | - public static $mimes = []; |
|
33 | + /** |
|
34 | + * Map of extensions to mime types. |
|
35 | + * |
|
36 | + * @var array $mimes |
|
37 | + */ |
|
38 | + public static $mimes = []; |
|
39 | 39 | |
40 | - /** |
|
41 | - * Constructor with an optional verification that the path is |
|
42 | - * really a mimes. |
|
43 | - * |
|
44 | - * @return mixed |
|
45 | - */ |
|
46 | - public function __construct() |
|
47 | - { |
|
48 | - static::$mimes = (array) require CON_PATH.'mimes.php'; |
|
49 | - } |
|
40 | + /** |
|
41 | + * Constructor with an optional verification that the path is |
|
42 | + * really a mimes. |
|
43 | + * |
|
44 | + * @return mixed |
|
45 | + */ |
|
46 | + public function __construct() |
|
47 | + { |
|
48 | + static::$mimes = (array) require CON_PATH.'mimes.php'; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Attempts to determine the best mime type for the given file extension. |
|
53 | - * |
|
54 | - * @param string $extension |
|
55 | - * |
|
56 | - * @return string|null The mime type found, or none if unable to determine |
|
57 | - */ |
|
58 | - public static function guessTypeFromExtension($extension) |
|
59 | - { |
|
60 | - $extension = trim(strtolower($extension), '. '); |
|
51 | + /** |
|
52 | + * Attempts to determine the best mime type for the given file extension. |
|
53 | + * |
|
54 | + * @param string $extension |
|
55 | + * |
|
56 | + * @return string|null The mime type found, or none if unable to determine |
|
57 | + */ |
|
58 | + public static function guessTypeFromExtension($extension) |
|
59 | + { |
|
60 | + $extension = trim(strtolower($extension), '. '); |
|
61 | 61 | |
62 | - if ( ! array_key_exists($extension, static::$mimes)) { |
|
63 | - return null; |
|
64 | - } |
|
62 | + if ( ! array_key_exists($extension, static::$mimes)) { |
|
63 | + return null; |
|
64 | + } |
|
65 | 65 | |
66 | - return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; |
|
67 | - } |
|
66 | + return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Attempts to determine the best file extension for a given mime type. |
|
71 | - * |
|
72 | - * @param string $type |
|
73 | - * |
|
74 | - * @return string|null The extension determined, or null if unable to match |
|
75 | - */ |
|
76 | - public static function guessExtensionFromType($type) |
|
77 | - { |
|
78 | - $type = trim(strtolower($type), '. '); |
|
69 | + /** |
|
70 | + * Attempts to determine the best file extension for a given mime type. |
|
71 | + * |
|
72 | + * @param string $type |
|
73 | + * |
|
74 | + * @return string|null The extension determined, or null if unable to match |
|
75 | + */ |
|
76 | + public static function guessExtensionFromType($type) |
|
77 | + { |
|
78 | + $type = trim(strtolower($type), '. '); |
|
79 | 79 | |
80 | - foreach (static::$mimes as $ext => $types) { |
|
81 | - if (is_string($types) && $types == $type) { |
|
82 | - return $ext; |
|
83 | - } elseif (is_array($types) && in_array($type, $types)) { |
|
84 | - return $ext; |
|
85 | - } |
|
86 | - } |
|
80 | + foreach (static::$mimes as $ext => $types) { |
|
81 | + if (is_string($types) && $types == $type) { |
|
82 | + return $ext; |
|
83 | + } elseif (is_array($types) && in_array($type, $types)) { |
|
84 | + return $ext; |
|
85 | + } |
|
86 | + } |
|
87 | 87 | |
88 | - return null; |
|
89 | - } |
|
88 | + return null; |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | \ No newline at end of file |
@@ -176,7 +176,7 @@ |
||
176 | 176 | $connection->setEventDispatcher($this->app['events']); |
177 | 177 | } |
178 | 178 | |
179 | - $connection->setReconnector(function ($connection) { |
|
179 | + $connection->setReconnector(function($connection) { |
|
180 | 180 | $this->reconnect($connection->getName()); |
181 | 181 | }); |
182 | 182 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]); |
73 | 73 | |
74 | - $callback = function ($matches) { |
|
74 | + $callback = function($matches) { |
|
75 | 75 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
76 | 76 | |
77 | 77 | return $matches[1] ? substr($matches[0], 1) : "<?php echo {$matches[2]}; ?>{$whitespace}"; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]); |
93 | 93 | |
94 | - $callback = function ($matches) { |
|
94 | + $callback = function($matches) { |
|
95 | 95 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
96 | 96 | |
97 | 97 | $wrapped = sprintf($this->echoFormat, $matches[2]); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]); |
115 | 115 | |
116 | - $callback = function ($matches) { |
|
116 | + $callback = function($matches) { |
|
117 | 117 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
118 | 118 | |
119 | 119 | return $matches[1] ? $matches[0] : "<?php echo e({$matches[2]}); ?>{$whitespace}"; |
@@ -164,7 +164,7 @@ |
||
164 | 164 | |
165 | 165 | foreach ($transitions as $transition) { |
166 | 166 | if ($transition['time'] > $this->format('U')) { |
167 | - $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving; |
|
167 | + $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function register() |
55 | 55 | { |
56 | - $this->booting(function () { |
|
56 | + $this->booting(function() { |
|
57 | 57 | $events = $this->listens(); |
58 | 58 | |
59 | 59 | foreach ((array) $events as $event => $listeners) { |
@@ -33,35 +33,35 @@ |
||
33 | 33 | */ |
34 | 34 | class PostTooLargeHttpException extends HttpException |
35 | 35 | { |
36 | - /** |
|
37 | - * Get the HTTP status code. |
|
38 | - * |
|
39 | - * @var int $code |
|
40 | - */ |
|
41 | - protected $code = 413; |
|
36 | + /** |
|
37 | + * Get the HTTP status code. |
|
38 | + * |
|
39 | + * @var int $code |
|
40 | + */ |
|
41 | + protected $code = 413; |
|
42 | 42 | |
43 | - /** |
|
44 | - * Initialize constructor. |
|
45 | - * |
|
46 | - * @param string|null $message |
|
47 | - * @param \Throwable|null $previous |
|
48 | - * @param int $code |
|
49 | - * @param array $headers |
|
50 | - * |
|
51 | - * @return void |
|
52 | - */ |
|
53 | - public function __construct( |
|
54 | - string $message = null, |
|
55 | - Throwable $previous = null, |
|
56 | - int $code = 0, |
|
57 | - array $headers = [] |
|
58 | - ) { |
|
43 | + /** |
|
44 | + * Initialize constructor. |
|
45 | + * |
|
46 | + * @param string|null $message |
|
47 | + * @param \Throwable|null $previous |
|
48 | + * @param int $code |
|
49 | + * @param array $headers |
|
50 | + * |
|
51 | + * @return void |
|
52 | + */ |
|
53 | + public function __construct( |
|
54 | + string $message = null, |
|
55 | + Throwable $previous = null, |
|
56 | + int $code = 0, |
|
57 | + array $headers = [] |
|
58 | + ) { |
|
59 | 59 | parent::__construct( |
60 | - $this->code, |
|
61 | - $message, |
|
62 | - $previous, |
|
63 | - $headers, |
|
64 | - $code |
|
65 | - ); |
|
66 | - } |
|
60 | + $this->code, |
|
61 | + $message, |
|
62 | + $previous, |
|
63 | + $headers, |
|
64 | + $code |
|
65 | + ); |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -34,143 +34,143 @@ |
||
34 | 34 | */ |
35 | 35 | class Configure implements ArrayAccess, ConfigureContract |
36 | 36 | { |
37 | - /** |
|
38 | - * Currently registered routes. |
|
39 | - * |
|
40 | - * @var array $vars |
|
41 | - */ |
|
42 | - protected $vars = []; |
|
37 | + /** |
|
38 | + * Currently registered routes. |
|
39 | + * |
|
40 | + * @var array $vars |
|
41 | + */ |
|
42 | + protected $vars = []; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Determine if the given configuration value exists. |
|
46 | - * |
|
47 | - * @param string $key |
|
48 | - * |
|
49 | - * @return bool |
|
50 | - */ |
|
51 | - public function has(string $key): bool |
|
52 | - { |
|
53 | - return Arr::has($this->vars, $key); |
|
54 | - } |
|
44 | + /** |
|
45 | + * Determine if the given configuration value exists. |
|
46 | + * |
|
47 | + * @param string $key |
|
48 | + * |
|
49 | + * @return bool |
|
50 | + */ |
|
51 | + public function has(string $key): bool |
|
52 | + { |
|
53 | + return Arr::has($this->vars, $key); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Returns a (dot notated) config setting. |
|
58 | - * |
|
59 | - * @param string $key The dot-notated key or array of keys |
|
60 | - * @param mixed $default The default value |
|
61 | - * |
|
62 | - * @return mixed |
|
63 | - */ |
|
64 | - public function get(string $key, mixed $default = null): mixed |
|
65 | - { |
|
66 | - $keys = explode('.', $key); |
|
56 | + /** |
|
57 | + * Returns a (dot notated) config setting. |
|
58 | + * |
|
59 | + * @param string $key The dot-notated key or array of keys |
|
60 | + * @param mixed $default The default value |
|
61 | + * |
|
62 | + * @return mixed |
|
63 | + */ |
|
64 | + public function get(string $key, mixed $default = null): mixed |
|
65 | + { |
|
66 | + $keys = explode('.', $key); |
|
67 | 67 | |
68 | - if ( ! array_key_exists($file = headItem($keys), $this->vars)) { |
|
69 | - foreach ([configPath().DIRECTORY_SEPARATOR] as $paths) { |
|
70 | - if (is_readable($path = $paths.$file.'.php')) { |
|
71 | - $this->vars[$file] = require $path; |
|
72 | - } |
|
73 | - } |
|
74 | - } |
|
68 | + if ( ! array_key_exists($file = headItem($keys), $this->vars)) { |
|
69 | + foreach ([configPath().DIRECTORY_SEPARATOR] as $paths) { |
|
70 | + if (is_readable($path = $paths.$file.'.php')) { |
|
71 | + $this->vars[$file] = require $path; |
|
72 | + } |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | - return Arr::get($this->vars, $key, $default); |
|
77 | - } |
|
76 | + return Arr::get($this->vars, $key, $default); |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * Sets a value in the config array. |
|
81 | - * |
|
82 | - * @param string $key The dot-notated key or array of keys |
|
83 | - * @param mixed $value The default value |
|
84 | - * |
|
85 | - * @return mixed |
|
86 | - */ |
|
87 | - public function set(string $key, mixed $value = null): mixed |
|
88 | - { |
|
89 | - $keys = is_array($key) ? $key : [$key => $value]; |
|
79 | + /** |
|
80 | + * Sets a value in the config array. |
|
81 | + * |
|
82 | + * @param string $key The dot-notated key or array of keys |
|
83 | + * @param mixed $value The default value |
|
84 | + * |
|
85 | + * @return mixed |
|
86 | + */ |
|
87 | + public function set(string $key, mixed $value = null): mixed |
|
88 | + { |
|
89 | + $keys = is_array($key) ? $key : [$key => $value]; |
|
90 | 90 | |
91 | - foreach ($keys as $key => $value) { |
|
92 | - Arr::set($this->vars, $key, $value); |
|
93 | - } |
|
94 | - } |
|
91 | + foreach ($keys as $key => $value) { |
|
92 | + Arr::set($this->vars, $key, $value); |
|
93 | + } |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Deletes a (dot notated) config item. |
|
98 | - * |
|
99 | - * @param string $key A (dot notated) config key |
|
100 | - * |
|
101 | - * @return void |
|
102 | - */ |
|
103 | - public function erase(string $key): void |
|
104 | - { |
|
105 | - if (isset($this->vars[$key])) { |
|
106 | - unset($this->vars[$key]); |
|
107 | - } |
|
96 | + /** |
|
97 | + * Deletes a (dot notated) config item. |
|
98 | + * |
|
99 | + * @param string $key A (dot notated) config key |
|
100 | + * |
|
101 | + * @return void |
|
102 | + */ |
|
103 | + public function erase(string $key): void |
|
104 | + { |
|
105 | + if (isset($this->vars[$key])) { |
|
106 | + unset($this->vars[$key]); |
|
107 | + } |
|
108 | 108 | |
109 | - Arr::erase($this->vars, $key); |
|
110 | - } |
|
109 | + Arr::erase($this->vars, $key); |
|
110 | + } |
|
111 | 111 | |
112 | - /** |
|
113 | - * Get all of the configuration items for the application. |
|
114 | - * |
|
115 | - * @return array |
|
116 | - */ |
|
117 | - public function all(): array |
|
118 | - { |
|
119 | - return $this->vars; |
|
120 | - } |
|
112 | + /** |
|
113 | + * Get all of the configuration items for the application. |
|
114 | + * |
|
115 | + * @return array |
|
116 | + */ |
|
117 | + public function all(): array |
|
118 | + { |
|
119 | + return $this->vars; |
|
120 | + } |
|
121 | 121 | |
122 | - /* |
|
122 | + /* |
|
123 | 123 | |----------------------------------------------------------------- |
124 | 124 | | ArrayAccess Methods |
125 | 125 | |----------------------------------------------------------------- |
126 | 126 | */ |
127 | 127 | |
128 | - /** |
|
129 | - * Determine if the given configuration option exists. |
|
130 | - * |
|
131 | - * @param string $key |
|
132 | - * |
|
133 | - * @return bool |
|
134 | - */ |
|
135 | - public function offsetExists($key): bool |
|
136 | - { |
|
137 | - return $this->has($key); |
|
138 | - } |
|
128 | + /** |
|
129 | + * Determine if the given configuration option exists. |
|
130 | + * |
|
131 | + * @param string $key |
|
132 | + * |
|
133 | + * @return bool |
|
134 | + */ |
|
135 | + public function offsetExists($key): bool |
|
136 | + { |
|
137 | + return $this->has($key); |
|
138 | + } |
|
139 | 139 | |
140 | - /** |
|
141 | - * Get a configuration option. |
|
142 | - * |
|
143 | - * @param string $key |
|
144 | - * |
|
145 | - * @return mixed |
|
146 | - */ |
|
147 | - public function offsetGet($key) |
|
148 | - { |
|
149 | - return $this->get($key); |
|
150 | - } |
|
140 | + /** |
|
141 | + * Get a configuration option. |
|
142 | + * |
|
143 | + * @param string $key |
|
144 | + * |
|
145 | + * @return mixed |
|
146 | + */ |
|
147 | + public function offsetGet($key) |
|
148 | + { |
|
149 | + return $this->get($key); |
|
150 | + } |
|
151 | 151 | |
152 | - /** |
|
153 | - * Set a configuration option. |
|
154 | - * |
|
155 | - * @param string $key |
|
156 | - * @param mixed $value |
|
157 | - * |
|
158 | - * @return void |
|
159 | - */ |
|
160 | - public function offsetSet($key, $value): void |
|
161 | - { |
|
162 | - $this->set($key, $value); |
|
163 | - } |
|
152 | + /** |
|
153 | + * Set a configuration option. |
|
154 | + * |
|
155 | + * @param string $key |
|
156 | + * @param mixed $value |
|
157 | + * |
|
158 | + * @return void |
|
159 | + */ |
|
160 | + public function offsetSet($key, $value): void |
|
161 | + { |
|
162 | + $this->set($key, $value); |
|
163 | + } |
|
164 | 164 | |
165 | - /** |
|
166 | - * Unset a configuration option. |
|
167 | - * |
|
168 | - * @param string $key |
|
169 | - * |
|
170 | - * @return void |
|
171 | - */ |
|
172 | - public function offsetUnset($key): void |
|
173 | - { |
|
174 | - $this->set($key, null); |
|
175 | - } |
|
165 | + /** |
|
166 | + * Unset a configuration option. |
|
167 | + * |
|
168 | + * @param string $key |
|
169 | + * |
|
170 | + * @return void |
|
171 | + */ |
|
172 | + public function offsetUnset($key): void |
|
173 | + { |
|
174 | + $this->set($key, null); |
|
175 | + } |
|
176 | 176 | } |
177 | 177 | \ No newline at end of file |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return $this->createClassListener($listener, $wildcard); |
133 | 133 | } |
134 | 134 | |
135 | - return function ($event, $payload) use ($listener, $wildcard) { |
|
135 | + return function($event, $payload) use ($listener, $wildcard) { |
|
136 | 136 | if ($wildcard) { |
137 | 137 | return $listener($event, $payload); |
138 | 138 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function createClassListener($listener, $wildcard = false): Closure |
153 | 153 | { |
154 | - return function ($event, $payload) use ($listener, $wildcard) { |
|
154 | + return function($event, $payload) use ($listener, $wildcard) { |
|
155 | 155 | if ($wildcard) { |
156 | 156 | return call_user_func($this->createClassClosure($listener), $event, $payload); |
157 | 157 | } |