@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function assertNothingSent() |
| 130 | 130 | { |
| 131 | - $mailableNames = collect($this->mailables)->map(function ($mailable) { |
|
| 131 | + $mailableNames = collect($this->mailables)->map(function($mailable) { |
|
| 132 | 132 | return get_class($mailable); |
| 133 | 133 | })->join(', '); |
| 134 | 134 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function assertNothingQueued() |
| 199 | 199 | { |
| 200 | - $mailableNames = collect($this->queuedMailables)->map(function ($mailable) { |
|
| 200 | + $mailableNames = collect($this->queuedMailables)->map(function($mailable) { |
|
| 201 | 201 | return get_class($mailable); |
| 202 | 202 | })->join(', '); |
| 203 | 203 | |
@@ -215,15 +215,15 @@ discard block |
||
| 215 | 215 | { |
| 216 | 216 | [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); |
| 217 | 217 | |
| 218 | - if (! $this->hasSent($mailable)) { |
|
| 218 | + if (!$this->hasSent($mailable)) { |
|
| 219 | 219 | return collect(); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $callback = $callback ?: function () { |
|
| 222 | + $callback = $callback ?: function() { |
|
| 223 | 223 | return true; |
| 224 | 224 | }; |
| 225 | 225 | |
| 226 | - return $this->mailablesOf($mailable)->filter(function ($mailable) use ($callback) { |
|
| 226 | + return $this->mailablesOf($mailable)->filter(function($mailable) use ($callback) { |
|
| 227 | 227 | return $callback($mailable); |
| 228 | 228 | }); |
| 229 | 229 | } |
@@ -250,15 +250,15 @@ discard block |
||
| 250 | 250 | { |
| 251 | 251 | [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); |
| 252 | 252 | |
| 253 | - if (! $this->hasQueued($mailable)) { |
|
| 253 | + if (!$this->hasQueued($mailable)) { |
|
| 254 | 254 | return collect(); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - $callback = $callback ?: function () { |
|
| 257 | + $callback = $callback ?: function() { |
|
| 258 | 258 | return true; |
| 259 | 259 | }; |
| 260 | 260 | |
| 261 | - return $this->queuedMailablesOf($mailable)->filter(function ($mailable) use ($callback) { |
|
| 261 | + return $this->queuedMailablesOf($mailable)->filter(function($mailable) use ($callback) { |
|
| 262 | 262 | return $callback($mailable); |
| 263 | 263 | }); |
| 264 | 264 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | */ |
| 283 | 283 | protected function mailablesOf($type) |
| 284 | 284 | { |
| 285 | - return collect($this->mailables)->filter(function ($mailable) use ($type) { |
|
| 285 | + return collect($this->mailables)->filter(function($mailable) use ($type) { |
|
| 286 | 286 | return $mailable instanceof $type; |
| 287 | 287 | }); |
| 288 | 288 | } |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | protected function queuedMailablesOf($type) |
| 297 | 297 | { |
| 298 | - return collect($this->queuedMailables)->filter(function ($mailable) use ($type) { |
|
| 298 | + return collect($this->queuedMailables)->filter(function($mailable) use ($type) { |
|
| 299 | 299 | return $mailable instanceof $type; |
| 300 | 300 | }); |
| 301 | 301 | } |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function send($view, array $data = [], $callback = null) |
| 359 | 359 | { |
| 360 | - if (! $view instanceof Mailable) { |
|
| 360 | + if (!$view instanceof Mailable) { |
|
| 361 | 361 | return; |
| 362 | 362 | } |
| 363 | 363 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | */ |
| 382 | 382 | public function queue($view, $queue = null) |
| 383 | 383 | { |
| 384 | - if (! $view instanceof Mailable) { |
|
| 384 | + if (!$view instanceof Mailable) { |
|
| 385 | 385 | return; |
| 386 | 386 | } |
| 387 | 387 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $messages = (array) $this->messages; |
| 91 | 91 | |
| 92 | - return ! isset($messages[$key]) || ! in_array($message, $messages[$key]); |
|
| 92 | + return !isset($messages[$key]) || !in_array($message, $messages[$key]); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | protected function getMessagesForWildcardKey($key, $format) |
| 211 | 211 | { |
| 212 | 212 | return collect($this->messages) |
| 213 | - ->filter(function ($messages, $messageKey) use ($key) { |
|
| 213 | + ->filter(function($messages, $messageKey) use ($key) { |
|
| 214 | 214 | return Str::is($key, $messageKey); |
| 215 | 215 | }) |
| 216 | - ->map(function ($messages, $messageKey) use ($format) { |
|
| 216 | + ->map(function($messages, $messageKey) use ($format) { |
|
| 217 | 217 | return $this->transform( |
| 218 | 218 | $messages, $this->checkFormat($format), $messageKey |
| 219 | 219 | ); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | protected function transform($messages, $format, $messageKey) |
| 262 | 262 | { |
| 263 | 263 | return collect((array) $messages) |
| 264 | - ->map(function ($message) use ($format, $messageKey) { |
|
| 264 | + ->map(function($message) use ($format, $messageKey) { |
|
| 265 | 265 | // We will simply spin through the given messages and transform each one |
| 266 | 266 | // replacing the :message place holder with the real message allowing |
| 267 | 267 | // the messages to be easily formatted to each developer's desires. |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | public function isEmpty() |
| 342 | 342 | { |
| 343 | - return ! $this->any(); |
|
| 343 | + return !$this->any(); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | protected function mergeConfigFrom($path, $key) |
| 133 | 133 | { |
| 134 | - if (! ($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) { |
|
| 134 | + if (!($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) { |
|
| 135 | 135 | $config = $this->app->make('config'); |
| 136 | 136 | |
| 137 | 137 | $config->set($key, array_merge( |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | protected function loadRoutesFrom($path) |
| 150 | 150 | { |
| 151 | - if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { |
|
| 151 | + if (!($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { |
|
| 152 | 152 | require $path; |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | protected function loadViewsFrom($path, $namespace) |
| 164 | 164 | { |
| 165 | - $this->callAfterResolving('view', function ($view) use ($path, $namespace) { |
|
| 165 | + $this->callAfterResolving('view', function($view) use ($path, $namespace) { |
|
| 166 | 166 | if (isset($this->app->config['view']['paths']) && |
| 167 | 167 | is_array($this->app->config['view']['paths'])) { |
| 168 | 168 | foreach ($this->app->config['view']['paths'] as $viewPath) { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | protected function loadViewComponentsAs($prefix, array $components) |
| 187 | 187 | { |
| 188 | - $this->callAfterResolving(BladeCompiler::class, function ($blade) use ($prefix, $components) { |
|
| 188 | + $this->callAfterResolving(BladeCompiler::class, function($blade) use ($prefix, $components) { |
|
| 189 | 189 | foreach ($components as $alias => $component) { |
| 190 | 190 | $blade->component($component, is_string($alias) ? $alias : null, $prefix); |
| 191 | 191 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | protected function loadTranslationsFrom($path, $namespace) |
| 203 | 203 | { |
| 204 | - $this->callAfterResolving('translator', function ($translator) use ($path, $namespace) { |
|
| 204 | + $this->callAfterResolving('translator', function($translator) use ($path, $namespace) { |
|
| 205 | 205 | $translator->addNamespace($namespace, $path); |
| 206 | 206 | }); |
| 207 | 207 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | protected function loadJsonTranslationsFrom($path) |
| 216 | 216 | { |
| 217 | - $this->callAfterResolving('translator', function ($translator) use ($path) { |
|
| 217 | + $this->callAfterResolving('translator', function($translator) use ($path) { |
|
| 218 | 218 | $translator->addJsonPath($path); |
| 219 | 219 | }); |
| 220 | 220 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | protected function loadMigrationsFrom($paths) |
| 229 | 229 | { |
| 230 | - $this->callAfterResolving('migrator', function ($migrator) use ($paths) { |
|
| 230 | + $this->callAfterResolving('migrator', function($migrator) use ($paths) { |
|
| 231 | 231 | foreach ((array) $paths as $path) { |
| 232 | 232 | $migrator->path($path); |
| 233 | 233 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function loadFactoriesFrom($paths) |
| 246 | 246 | { |
| 247 | - $this->callAfterResolving(ModelFactory::class, function ($factory) use ($paths) { |
|
| 247 | + $this->callAfterResolving(ModelFactory::class, function($factory) use ($paths) { |
|
| 248 | 248 | foreach ((array) $paths as $path) { |
| 249 | 249 | $factory->load($path); |
| 250 | 250 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | protected function ensurePublishArrayInitialized($class) |
| 295 | 295 | { |
| 296 | - if (! array_key_exists($class, static::$publishes)) { |
|
| 296 | + if (!array_key_exists($class, static::$publishes)) { |
|
| 297 | 297 | static::$publishes[$class] = []; |
| 298 | 298 | } |
| 299 | 299 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | protected function addPublishGroup($group, $paths) |
| 309 | 309 | { |
| 310 | - if (! array_key_exists($group, static::$publishGroups)) { |
|
| 310 | + if (!array_key_exists($group, static::$publishGroups)) { |
|
| 311 | 311 | static::$publishGroups[$group] = []; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -325,11 +325,11 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | public static function pathsToPublish($provider = null, $group = null) |
| 327 | 327 | { |
| 328 | - if (! is_null($paths = static::pathsForProviderOrGroup($provider, $group))) { |
|
| 328 | + if (!is_null($paths = static::pathsForProviderOrGroup($provider, $group))) { |
|
| 329 | 329 | return $paths; |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | - return collect(static::$publishes)->reduce(function ($paths, $p) { |
|
| 332 | + return collect(static::$publishes)->reduce(function($paths, $p) { |
|
| 333 | 333 | return array_merge($paths, $p); |
| 334 | 334 | }, []); |
| 335 | 335 | } |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | */ |
| 364 | 364 | protected static function pathsForProviderAndGroup($provider, $group) |
| 365 | 365 | { |
| 366 | - if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { |
|
| 366 | + if (!empty(static::$publishes[$provider]) && !empty(static::$publishGroups[$group])) { |
|
| 367 | 367 | return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); |
| 368 | 368 | } |
| 369 | 369 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | { |
| 401 | 401 | $commands = is_array($commands) ? $commands : func_get_args(); |
| 402 | 402 | |
| 403 | - Artisan::starting(function ($artisan) use ($commands) { |
|
| 403 | + Artisan::starting(function($artisan) use ($commands) { |
|
| 404 | 404 | $artisan->resolveCommands($commands); |
| 405 | 405 | }); |
| 406 | 406 | } |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public static function isCallable($var, $syntaxOnly = false) |
| 20 | 20 | { |
| 21 | - if (! is_array($var)) { |
|
| 21 | + if (!is_array($var)) { |
|
| 22 | 22 | return is_callable($var, $syntaxOnly); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if ((! isset($var[0]) || ! isset($var[1])) || |
|
| 26 | - ! is_string($var[1] ?? null)) { |
|
| 25 | + if ((!isset($var[0]) || !isset($var[1])) || |
|
| 26 | + !is_string($var[1] ?? null)) { |
|
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $method = $var[1]; |
| 39 | 39 | |
| 40 | - if (! class_exists($class)) { |
|
| 40 | + if (!class_exists($class)) { |
|
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | return (new ReflectionMethod($class, '__call'))->isPublic(); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (! is_object($var[0]) && method_exists($class, '__callStatic')) { |
|
| 52 | + if (!is_object($var[0]) && method_exists($class, '__callStatic')) { |
|
| 53 | 53 | return (new ReflectionMethod($class, '__callStatic'))->isPublic(); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $type = $parameter->getType(); |
| 68 | 68 | |
| 69 | - if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { |
|
| 69 | + if (!$type instanceof ReflectionNamedType || $type->isBuiltin()) { |
|
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | $type = $parameter->getType(); |
| 85 | 85 | |
| 86 | - if (! $type instanceof ReflectionUnionType) { |
|
| 86 | + if (!$type instanceof ReflectionUnionType) { |
|
| 87 | 87 | return array_filter([static::getParameterClassName($parameter)]); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $unionTypes = []; |
| 91 | 91 | |
| 92 | 92 | foreach ($type->getTypes() as $listedType) { |
| 93 | - if (! $listedType instanceof ReflectionNamedType || $listedType->isBuiltin()) { |
|
| 93 | + if (!$listedType instanceof ReflectionNamedType || $listedType->isBuiltin()) { |
|
| 94 | 94 | continue; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $name = $type->getName(); |
| 113 | 113 | |
| 114 | - if (! is_null($class = $parameter->getDeclaringClass())) { |
|
| 114 | + if (!is_null($class = $parameter->getDeclaringClass())) { |
|
| 115 | 115 | if ($name === 'self') { |
| 116 | 116 | return $class->getName(); |
| 117 | 117 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | public static function get($key, $default = null) |
| 75 | 75 | { |
| 76 | 76 | return Option::fromValue(static::getRepository()->get($key)) |
| 77 | - ->map(function ($value) { |
|
| 77 | + ->map(function($value) { |
|
| 78 | 78 | switch (strtolower($value)) { |
| 79 | 79 | case 'true': |
| 80 | 80 | case '(true)': |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | return $value; |
| 98 | 98 | }) |
| 99 | - ->getOrCall(function () use ($default) { |
|
| 99 | + ->getOrCall(function() use ($default) { |
|
| 100 | 100 | return value($default); |
| 101 | 101 | }); |
| 102 | 102 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function unless($value, $callback, $default = null) |
| 35 | 35 | { |
| 36 | - if (! $value) { |
|
| 36 | + if (!$value) { |
|
| 37 | 37 | return $callback($this, $value) ?: $this; |
| 38 | 38 | } elseif ($default) { |
| 39 | 39 | return $default($this, $value) ?: $this; |
@@ -21,10 +21,10 @@ |
||
| 21 | 21 | { |
| 22 | 22 | try { |
| 23 | 23 | return $object->{$method}(...$parameters); |
| 24 | - } catch (Error|BadMethodCallException $e) { |
|
| 24 | + } catch (Error | BadMethodCallException $e) { |
|
| 25 | 25 | $pattern = '~^Call to undefined method (?P<class>[^:]+)::(?P<method>[^\(]+)\(\)$~'; |
| 26 | 26 | |
| 27 | - if (! preg_match($pattern, $e->getMessage(), $matches)) { |
|
| 27 | + if (!preg_match($pattern, $e->getMessage(), $matches)) { |
|
| 28 | 28 | throw $e; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $types = array_values($this->closureParameterTypes($closure)); |
| 24 | 24 | |
| 25 | - if (! $types) { |
|
| 25 | + if (!$types) { |
|
| 26 | 26 | throw new RuntimeException('The given Closure has no parameters.'); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $reflection = new ReflectionFunction($closure); |
| 48 | 48 | |
| 49 | - $types = collect($reflection->getParameters())->mapWithKeys(function ($parameter) { |
|
| 49 | + $types = collect($reflection->getParameters())->mapWithKeys(function($parameter) { |
|
| 50 | 50 | if ($parameter->isVariadic()) { |
| 51 | 51 | return [$parameter->getName() => null]; |
| 52 | 52 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $reflection = new ReflectionFunction($closure); |
| 79 | 79 | |
| 80 | - return collect($reflection->getParameters())->mapWithKeys(function ($parameter) { |
|
| 80 | + return collect($reflection->getParameters())->mapWithKeys(function($parameter) { |
|
| 81 | 81 | if ($parameter->isVariadic()) { |
| 82 | 82 | return [$parameter->getName() => null]; |
| 83 | 83 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function withLocale($locale, $callback) |
| 17 | 17 | { |
| 18 | - if (! $locale) { |
|
| 18 | + if (!$locale) { |
|
| 19 | 19 | return $callback(); |
| 20 | 20 | } |
| 21 | 21 | |