@@ -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 |
@@ -175,10 +175,10 @@ |
||
175 | 175 | */ |
176 | 176 | public function setAdapter(string $adapter, array $config = []): self |
177 | 177 | { |
178 | - if (! array_key_exists($adapter, self::$validAdapters)) { |
|
178 | + if (!array_key_exists($adapter, self::$validAdapters)) { |
|
179 | 179 | $adapter = 'native'; |
180 | 180 | } |
181 | - if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) { |
|
181 | + if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) { |
|
182 | 182 | $this->config['adapters'] = []; |
183 | 183 | } |
184 | 184 |
@@ -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 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function getLine(string $line, ?array $args = []) |
94 | 94 | { |
95 | 95 | // ignore requests with no file specified |
96 | - if (! strpos($line, '.')) { |
|
96 | + if (!strpos($line, '.')) { |
|
97 | 97 | return $line; |
98 | 98 | } |
99 | 99 | if (empty($args)) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $output ??= $line; |
132 | 132 | |
133 | - if (! empty($args)) { |
|
133 | + if (!empty($args)) { |
|
134 | 134 | $output = $this->formatMessage($output, $args); |
135 | 135 | } |
136 | 136 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $line = implode('.', $line); |
153 | 153 | */ |
154 | 154 | |
155 | - if (! isset($this->language[$locale][$file]) || ! array_key_exists($line, $this->language[$locale][$file])) { |
|
155 | + if (!isset($this->language[$locale][$file]) || !array_key_exists($line, $this->language[$locale][$file])) { |
|
156 | 156 | $this->load($file, $locale); |
157 | 157 | } |
158 | 158 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function formatMessage($message, array $args = []) |
174 | 174 | { |
175 | - if (! $this->intlSupport || ! $args) { |
|
175 | + if (!$this->intlSupport || !$args) { |
|
176 | 176 | return $message; |
177 | 177 | } |
178 | 178 | |
@@ -196,18 +196,18 @@ discard block |
||
196 | 196 | */ |
197 | 197 | protected function load(string $file, string $locale, bool $return = false) |
198 | 198 | { |
199 | - if (! array_key_exists($locale, $this->loadedFiles)) { |
|
199 | + if (!array_key_exists($locale, $this->loadedFiles)) { |
|
200 | 200 | $this->loadedFiles[$locale] = []; |
201 | 201 | } |
202 | 202 | if (in_array($file, $this->loadedFiles[$locale], true)) { |
203 | 203 | // Don't load it more than once. |
204 | 204 | return []; |
205 | 205 | } |
206 | - if (! array_key_exists($locale, $this->language)) { |
|
206 | + if (!array_key_exists($locale, $this->language)) { |
|
207 | 207 | $this->language[$locale] = []; |
208 | 208 | } |
209 | 209 | |
210 | - if (! array_key_exists($file, $this->language[$locale])) { |
|
210 | + if (!array_key_exists($file, $this->language[$locale])) { |
|
211 | 211 | $this->language[$locale][$file] = []; |
212 | 212 | } |
213 | 213 |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | public static function mixin($mixin, $replace = true) |
53 | 53 | { |
54 | 54 | $methods = (new ReflectionClass($mixin))->getMethods( |
55 | - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED |
|
55 | + ReflectionMethod::IS_PUBLIC|ReflectionMethod::IS_PROTECTED |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | foreach ($methods as $method) { |
59 | - if ($replace || ! static::hasMacro($method->name)) { |
|
59 | + if ($replace || !static::hasMacro($method->name)) { |
|
60 | 60 | $method->setAccessible(true); |
61 | 61 | static::macro($method->name, $method->invoke($mixin)); |
62 | 62 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public static function __callStatic($method, $parameters) |
89 | 89 | { |
90 | - if (! static::hasMacro($method)) { |
|
90 | + if (!static::hasMacro($method)) { |
|
91 | 91 | throw new BadMethodCallException(sprintf( |
92 | 92 | 'Method %s::%s does not exist.', |
93 | 93 | static::class, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function __call($method, $parameters) |
118 | 118 | { |
119 | - if (! static::hasMacro($method)) { |
|
119 | + if (!static::hasMacro($method)) { |
|
120 | 120 | throw new BadMethodCallException(sprintf( |
121 | 121 | 'Method %s::%s does not exist.', |
122 | 122 | static::class, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public static function setConfig($key, $config = null): void |
72 | 72 | { |
73 | 73 | if ($config === null) { |
74 | - if (! is_array($key)) { |
|
74 | + if (!is_array($key)) { |
|
75 | 75 | throw new LogicException('If config is null, key must be an array.'); |
76 | 76 | } |
77 | 77 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public static function getConfigOrFail(string $key) |
132 | 132 | { |
133 | - if (! isset(static::$_config[$key])) { |
|
133 | + if (!isset(static::$_config[$key])) { |
|
134 | 134 | throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key)); |
135 | 135 | } |
136 | 136 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public static function drop(string $config): bool |
154 | 154 | { |
155 | - if (! isset(static::$_config[$config])) { |
|
155 | + if (!isset(static::$_config[$config])) { |
|
156 | 156 | return false; |
157 | 157 | } |
158 | 158 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | preg_match($pattern, $dsn, $parsed); |
252 | 252 | |
253 | - if (! $parsed) { |
|
253 | + if (!$parsed) { |
|
254 | 254 | throw new InvalidArgumentException("The DSN string '{$dsn}' could not be parsed."); |
255 | 255 | } |
256 | 256 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } elseif (strpos($k, '_') === 0) { |
263 | 263 | $exists[substr($k, 1)] = ($v !== ''); |
264 | 264 | unset($parsed[$k]); |
265 | - } elseif ($v === '' && ! $exists[$k]) { |
|
265 | + } elseif ($v === '' && !$exists[$k]) { |
|
266 | 266 | unset($parsed[$k]); |
267 | 267 | } |
268 | 268 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function setConfig($key, $value = null, bool $merge = true): self |
69 | 69 | { |
70 | - if (! $this->_configInitialized) { |
|
70 | + if (!$this->_configInitialized) { |
|
71 | 71 | $this->_config = $this->_defaultConfig; |
72 | 72 | $this->_configInitialized = true; |
73 | 73 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getConfig(?string $key = null, $default = null) |
114 | 114 | { |
115 | - if (! $this->_configInitialized) { |
|
115 | + if (!$this->_configInitialized) { |
|
116 | 116 | $this->_config = $this->_defaultConfig; |
117 | 117 | $this->_configInitialized = true; |
118 | 118 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function configShallow($key, $value = null): self |
168 | 168 | { |
169 | - if (! $this->_configInitialized) { |
|
169 | + if (!$this->_configInitialized) { |
|
170 | 170 | $this->_config = $this->_defaultConfig; |
171 | 171 | $this->_configInitialized = true; |
172 | 172 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $return = $this->_config; |
193 | 193 | |
194 | 194 | foreach (explode('.', $key) as $k) { |
195 | - if (! is_array($return) || ! isset($return[$k])) { |
|
195 | + if (!is_array($return) || !isset($return[$k])) { |
|
196 | 196 | $return = null; |
197 | 197 | break; |
198 | 198 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $stack = explode('.', $key); |
251 | 251 | |
252 | 252 | foreach ($stack as $k) { |
253 | - if (! is_array($update)) { |
|
253 | + if (!is_array($update)) { |
|
254 | 254 | throw new Exception(sprintf('Cannot set %s value', $key)); |
255 | 255 | } |
256 | 256 | |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | $length = count($stack); |
281 | 281 | |
282 | 282 | foreach ($stack as $i => $k) { |
283 | - if (! is_array($update)) { |
|
283 | + if (!is_array($update)) { |
|
284 | 284 | throw new Exception(sprintf('Cannot unset %s value', $key)); |
285 | 285 | } |
286 | 286 | |
287 | - if (! isset($update[$k])) { |
|
287 | + if (!isset($update[$k])) { |
|
288 | 288 | break; |
289 | 289 | } |
290 | 290 |
@@ -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 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | // Forcez-le à être quelque chose d'utile |
46 | - if (! is_array($data) && ! is_object($data)) { |
|
46 | + if (!is_array($data) && !is_object($data)) { |
|
47 | 47 | $data = (array) $data; |
48 | 48 | } |
49 | 49 |