@@ -69,7 +69,7 @@ |
||
69 | 69 | { |
70 | 70 | $this->invalidate(); |
71 | 71 | |
72 | - if ($overwrite || ! isset($this->configSchemas[$key])) { |
|
72 | + if ($overwrite || !isset($this->configSchemas[$key])) { |
|
73 | 73 | $this->configSchemas[$key] = $schema; |
74 | 74 | } |
75 | 75 | } |
@@ -327,14 +327,14 @@ |
||
327 | 327 | */ |
328 | 328 | private function setFormatter(object $handler, array $allowed, ?string $format = 'json'): object |
329 | 329 | { |
330 | - if (! method_exists($handler, 'setFormatter')) { |
|
330 | + if (!method_exists($handler, 'setFormatter')) { |
|
331 | 331 | return $handler; |
332 | 332 | } |
333 | 333 | |
334 | 334 | if (empty($format)) { |
335 | 335 | $format = 'json'; |
336 | 336 | } |
337 | - if (! empty($allowed) && ! in_array($format, $allowed, true)) { |
|
337 | + if (!empty($allowed) && !in_array($format, $allowed, true)) { |
|
338 | 338 | throw new InvalidArgumentException('Invalid formatter for log file handler. Accepts values: ' . implode('/', $allowed)); |
339 | 339 | } |
340 | 340 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function start(string $name, ?float $time = null): self |
35 | 35 | { |
36 | 36 | $this->timers[strtolower($name)] = [ |
37 | - 'start' => ! empty($time) ? $time : microtime(true), |
|
37 | + 'start' => !empty($time) ? $time : microtime(true), |
|
38 | 38 | 'end' => null, |
39 | 39 | ]; |
40 | 40 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | $body = $response->getBody(); |
113 | 113 | |
114 | - if (! $body->isSeekable()) { |
|
114 | + if (!$body->isSeekable()) { |
|
115 | 115 | echo $body; |
116 | 116 | |
117 | 117 | return; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $body->rewind(); |
121 | 121 | |
122 | - while (! $body->eof()) { |
|
122 | + while (!$body->eof()) { |
|
123 | 123 | echo $body->read($maxBufferLength); |
124 | 124 | } |
125 | 125 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $body = $response->getBody(); |
140 | 140 | |
141 | - if (! $body->isSeekable()) { |
|
141 | + if (!$body->isSeekable()) { |
|
142 | 142 | $contents = $body->getContents(); |
143 | 143 | echo substr($contents, $first, $last - $first + 1); |
144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $pos = 0; |
151 | 151 | $length = $last - $first + 1; |
152 | 152 | |
153 | - while (! $body->eof() && $pos < $length) { |
|
153 | + while (!$body->eof() && $pos < $length) { |
|
154 | 154 | if (($pos + $maxBufferLength) > $length) { |
155 | 155 | echo $body->read($length - $pos); |
156 | 156 | break; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $key = strtolower($key); |
234 | 234 | $data[$key] = $value; |
235 | 235 | } |
236 | - if (! empty($data['expires'])) { |
|
236 | + if (!empty($data['expires'])) { |
|
237 | 237 | $data['expires'] = strtotime($data['expires']); |
238 | 238 | } |
239 | 239 | setcookie( |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $this->_streamMode = $options['streamMode'] ?? $this->_streamMode; |
451 | 451 | |
452 | 452 | if (isset($options['stream'])) { |
453 | - if (! $options['stream'] instanceof StreamInterface) { |
|
453 | + if (!$options['stream'] instanceof StreamInterface) { |
|
454 | 454 | throw new InvalidArgumentException('Stream option must be an object that implements StreamInterface'); |
455 | 455 | } |
456 | 456 | $this->stream = $options['stream']; |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | $this->_setStatus($options['status']); |
467 | 467 | } |
468 | 468 | |
469 | - if (! isset($options['charset'])) { |
|
469 | + if (!isset($options['charset'])) { |
|
470 | 470 | $options['charset'] = config('app.charset'); |
471 | 471 | } |
472 | 472 | $this->_charset = $options['charset']; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | protected function _clearHeader(string $header): void |
595 | 595 | { |
596 | 596 | $normalized = strtolower($header); |
597 | - if (! isset($this->headerNames[$normalized])) { |
|
597 | + if (!isset($this->headerNames[$normalized])) { |
|
598 | 598 | return; |
599 | 599 | } |
600 | 600 | $original = $this->headerNames[$normalized]; |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | */ |
834 | 834 | public function withCache($since, $time = '+1 day'): static |
835 | 835 | { |
836 | - if (! is_int($time)) { |
|
836 | + if (!is_int($time)) { |
|
837 | 837 | $time = strtotime($time); |
838 | 838 | if ($time === false) { |
839 | 839 | throw new InvalidArgumentException( |
@@ -1287,7 +1287,7 @@ discard block |
||
1287 | 1287 | */ |
1288 | 1288 | public function getCookie(string $name): ?array |
1289 | 1289 | { |
1290 | - if (! $this->_cookies->has($name)) { |
|
1290 | + if (!$this->_cookies->has($name)) { |
|
1291 | 1291 | return null; |
1292 | 1292 | } |
1293 | 1293 | |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | |
1361 | 1361 | $extension = strtolower($file->getExtension()); |
1362 | 1362 | $mapped = $this->getMimeType($extension); |
1363 | - if ((! $extension || ! $mapped) && $options['download'] === null) { |
|
1363 | + if ((!$extension || !$mapped) && $options['download'] === null) { |
|
1364 | 1364 | $options['download'] = true; |
1365 | 1365 | } |
1366 | 1366 | |
@@ -1424,12 +1424,12 @@ discard block |
||
1424 | 1424 | if (strpos($path, '../') !== false || strpos($path, '..\\') !== false) { |
1425 | 1425 | throw new LoadException('The requested file contains `..` and will not be read.'); |
1426 | 1426 | } |
1427 | - if (! is_file($path)) { |
|
1428 | - $path = APP_PATH . $path; // @phpstan-ignore-line |
|
1427 | + if (!is_file($path)) { |
|
1428 | + $path = APP_PATH . $path; // @phpstan-ignore-line |
|
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | $file = new SplFileInfo($path); |
1432 | - if (! $file->isFile() || ! $file->isReadable()) { |
|
1432 | + if (!$file->isFile() || !$file->isReadable()) { |
|
1433 | 1433 | if (on_dev()) { |
1434 | 1434 | throw new LoadException(sprintf('The requested file %s was not found or not readable', $path)); |
1435 | 1435 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Sort to get the highest results first |
209 | - usort($results, static function ($a, $b) { |
|
209 | + usort($results, static function($a, $b) { |
|
210 | 210 | if ($a['q'] === $b['q']) { |
211 | 211 | $a_ast = substr_count($a['value'], '*'); |
212 | 212 | $b_ast = substr_count($b['value'], '*'); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | } |
277 | 277 | |
278 | 278 | foreach ($supported['params'] as $label => $value) { |
279 | - if (! isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
279 | + if (!isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
280 | 280 | return false; |
281 | 281 | } |
282 | 282 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $auto_refresh = $this->config['auto_refresh'] ?? 'auto'; |
71 | 71 | if ($auto_refresh === 'auto') { |
72 | - $auto_refresh = ! is_online(); |
|
72 | + $auto_refresh = !is_online(); |
|
73 | 73 | } |
74 | 74 | $this->latte->setAutoRefresh($auto_refresh); |
75 | 75 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function __construct(array $events = []) |
48 | 48 | { |
49 | 49 | $this->events = $events; |
50 | - if (! array_key_exists(self::WILDCARD, $this->events)) { |
|
50 | + if (!array_key_exists(self::WILDCARD, $this->events)) { |
|
51 | 51 | $this->events[self::WILDCARD] = []; |
52 | 52 | } |
53 | 53 | } |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function attach(string $event, callable $callback, int $priority = 0): bool |
67 | 67 | { |
68 | - if (! array_key_exists($event, $this->events)) { |
|
68 | + if (!array_key_exists($event, $this->events)) { |
|
69 | 69 | $this->events[$event] = []; |
70 | 70 | } |
71 | - if (! array_key_exists($priority, $this->events[$event])) { |
|
71 | + if (!array_key_exists($priority, $this->events[$event])) { |
|
72 | 72 | $this->events[$event][$priority] = []; |
73 | 73 | } |
74 | 74 | |
75 | - if (! in_array($callback, $this->events[$event][$priority], true)) { |
|
75 | + if (!in_array($callback, $this->events[$event][$priority], true)) { |
|
76 | 76 | $this->events[$event][$priority][] = $callback; |
77 | 77 | |
78 | 78 | return true; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function detach(string $event, callable $callback): bool |
96 | 96 | { |
97 | - if (! array_key_exists($event, $this->events) || ! $this->events[$event]) { |
|
97 | + if (!array_key_exists($event, $this->events) || !$this->events[$event]) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function trigger($event, $target = null, $argv = []) |
117 | 117 | { |
118 | - if (! ($event instanceof EventInterface)) { |
|
118 | + if (!($event instanceof EventInterface)) { |
|
119 | 119 | $event = new Event($event, $target, $argv); |
120 | 120 | } else { |
121 | 121 | if ($target) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | |
129 | 129 | $eventName = $event->getName(); |
130 | - if (! array_key_exists($eventName, $this->events)) { |
|
130 | + if (!array_key_exists($eventName, $this->events)) { |
|
131 | 131 | $this->events[$eventName] = []; |
132 | 132 | } |
133 | 133 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $result = null; |
136 | 136 | |
137 | 137 | foreach ($events as $priority) { |
138 | - if (! is_array($priority)) { |
|
138 | + if (!is_array($priority)) { |
|
139 | 139 | continue; |
140 | 140 | } |
141 | 141 |
@@ -53,19 +53,19 @@ |
||
53 | 53 | */ |
54 | 54 | public static function type(string $mime): FormatterInterface |
55 | 55 | { |
56 | - if (! array_key_exists($mime, self::$formatters)) { |
|
56 | + if (!array_key_exists($mime, self::$formatters)) { |
|
57 | 57 | throw FormatException::invalidMime($mime); |
58 | 58 | } |
59 | 59 | |
60 | 60 | $className = self::$formatters[$mime]; |
61 | 61 | |
62 | - if (! class_exists($className)) { |
|
62 | + if (!class_exists($className)) { |
|
63 | 63 | throw FormatException::invalidFormatter($className); |
64 | 64 | } |
65 | 65 | |
66 | 66 | $class = new $className(); |
67 | 67 | |
68 | - if (! $class instanceof FormatterInterface) { |
|
68 | + if (!$class instanceof FormatterInterface) { |
|
69 | 69 | throw FormatException::invalidFormatter($className); |
70 | 70 | } |
71 | 71 |