From 67226679df52894f41f3bf1a53a9537ed33e7fa9 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sat, 1 Aug 2015 01:02:33 +0100 Subject: [PATCH] CS fixes --- .php_cs | 44 ++++-- .styleci.yml | 1 + src/Illuminate/Auth/AuthManager.php | 4 +- src/Illuminate/Auth/DatabaseUserProvider.php | 2 +- src/Illuminate/Auth/EloquentUserProvider.php | 2 +- src/Illuminate/Auth/Guard.php | 28 ++-- .../Passwords/DatabaseTokenRepository.php | 2 +- .../Auth/Passwords/PasswordBroker.php | 10 +- src/Illuminate/Bus/Dispatcher.php | 2 +- src/Illuminate/Cache/DatabaseStore.php | 4 +- src/Illuminate/Cache/MemcachedConnector.php | 2 +- src/Illuminate/Cache/RateLimiter.php | 138 +++++++++--------- src/Illuminate/Cache/RedisStore.php | 2 +- src/Illuminate/Cache/Repository.php | 8 +- src/Illuminate/Cache/TaggedCache.php | 10 +- src/Illuminate/Console/Command.php | 2 +- src/Illuminate/Console/ConfirmableTrait.php | 2 +- src/Illuminate/Console/GeneratorCommand.php | 2 +- src/Illuminate/Console/Parser.php | 2 +- .../Console/Scheduling/CallbackEvent.php | 4 +- src/Illuminate/Console/Scheduling/Event.php | 4 +- src/Illuminate/Container/Container.php | 18 +-- src/Illuminate/Contracts/Support/Htmlable.php | 2 +- src/Illuminate/Cookie/CookieJar.php | 2 +- src/Illuminate/Database/Connection.php | 2 +- .../Database/Connectors/ConnectionFactory.php | 2 +- .../Database/Connectors/MySqlConnector.php | 4 +- .../Console/Migrations/MigrateCommand.php | 6 +- .../Console/Migrations/MigrateMakeCommand.php | 4 +- .../Console/Migrations/RefreshCommand.php | 2 +- .../Console/Migrations/ResetCommand.php | 4 +- .../Console/Migrations/RollbackCommand.php | 2 +- .../Console/Migrations/StatusCommand.php | 2 +- .../Database/Console/Seeds/SeedCommand.php | 2 +- src/Illuminate/Database/DatabaseManager.php | 4 +- src/Illuminate/Database/Eloquent/Builder.php | 8 +- .../Database/Eloquent/Collection.php | 4 +- .../Database/Eloquent/FactoryBuilder.php | 2 +- src/Illuminate/Database/Eloquent/Model.php | 62 ++++---- .../Database/Eloquent/Relations/BelongsTo.php | 2 +- .../Eloquent/Relations/BelongsToMany.php | 8 +- .../Database/Eloquent/Relations/MorphTo.php | 2 +- .../Database/Eloquent/SoftDeletes.php | 2 +- .../Database/Migrations/MigrationCreator.php | 2 +- .../Database/Migrations/Migrator.php | 2 +- src/Illuminate/Database/Query/Builder.php | 20 +-- .../Database/Query/Grammars/Grammar.php | 8 +- .../Query/Grammars/PostgresGrammar.php | 4 +- .../Database/Query/Grammars/SQLiteGrammar.php | 2 +- .../Query/Grammars/SqlServerGrammar.php | 6 +- src/Illuminate/Database/Schema/Blueprint.php | 14 +- src/Illuminate/Database/Schema/Builder.php | 2 +- .../Database/Schema/Grammars/Grammar.php | 8 +- .../Database/Schema/Grammars/MySqlGrammar.php | 20 +-- .../Schema/Grammars/PostgresGrammar.php | 2 +- .../Schema/Grammars/SQLiteGrammar.php | 8 +- .../Schema/Grammars/SqlServerGrammar.php | 2 +- src/Illuminate/Encryption/BaseEncrypter.php | 6 +- src/Illuminate/Events/CallQueuedHandler.php | 2 +- src/Illuminate/Events/Dispatcher.php | 6 +- src/Illuminate/Filesystem/Filesystem.php | 16 +- src/Illuminate/Foundation/AliasLoader.php | 2 +- src/Illuminate/Foundation/Application.php | 12 +- .../Foundation/Auth/AuthenticatesUsers.php | 1 - .../Foundation/Bootstrap/HandleExceptions.php | 6 +- .../Bootstrap/LoadConfiguration.php | 2 +- .../Console/EventGenerateCommand.php | 2 +- .../Console/HandlerEventCommand.php | 2 +- .../Foundation/Console/IlluminateCaster.php | 4 +- src/Illuminate/Foundation/Console/Kernel.php | 2 +- .../Console/ListenerMakeCommand.php | 2 +- .../Foundation/Console/OptimizeCommand.php | 2 +- .../Foundation/Console/RouteListCommand.php | 14 +- .../Console/VendorPublishCommand.php | 6 +- .../Foundation/EnvironmentDetector.php | 2 +- .../Foundation/Exceptions/Handler.php | 2 +- src/Illuminate/Foundation/Http/Kernel.php | 3 +- .../Http/Middleware/VerifyCsrfToken.php | 2 +- .../Foundation/Testing/ApplicationTrait.php | 2 +- .../Foundation/Testing/AssertionsTrait.php | 4 +- .../Foundation/Testing/CrawlerTrait.php | 18 +-- .../Foundation/Testing/TestCase.php | 2 +- src/Illuminate/Foundation/helpers.php | 82 +++++------ src/Illuminate/Http/RedirectResponse.php | 2 +- src/Illuminate/Http/Request.php | 16 +- src/Illuminate/Log/Writer.php | 2 +- src/Illuminate/Mail/Mailer.php | 6 +- .../Pagination/AbstractPaginator.php | 2 +- ...apThreeNextPreviousButtonRendererTrait.php | 2 +- src/Illuminate/Pagination/UrlWindow.php | 2 +- src/Illuminate/Queue/CallQueuedHandler.php | 2 +- src/Illuminate/Queue/Console/RetryCommand.php | 2 +- .../Queue/Console/SubscribeCommand.php | 4 +- src/Illuminate/Queue/Console/WorkCommand.php | 4 +- src/Illuminate/Queue/DatabaseQueue.php | 2 +- src/Illuminate/Queue/IronQueue.php | 2 +- src/Illuminate/Queue/Jobs/IronJob.php | 2 +- src/Illuminate/Queue/QueueManager.php | 2 +- src/Illuminate/Queue/RedisQueue.php | 4 +- src/Illuminate/Queue/Worker.php | 8 +- .../Routing/ControllerDispatcher.php | 10 +- .../Routing/Matching/SchemeValidator.php | 2 +- src/Illuminate/Routing/ResourceRegistrar.php | 4 +- src/Illuminate/Routing/ResponseFactory.php | 4 +- src/Illuminate/Routing/Route.php | 22 +-- src/Illuminate/Routing/RouteCollection.php | 6 +- .../Routing/RouteDependencyResolverTrait.php | 6 +- src/Illuminate/Routing/Router.php | 26 ++-- src/Illuminate/Routing/UrlGenerator.php | 10 +- .../Session/CacheBasedSessionHandler.php | 12 +- .../Session/CookieSessionHandler.php | 12 +- .../Session/DatabaseSessionHandler.php | 12 +- src/Illuminate/Session/FileSessionHandler.php | 12 +- .../Session/Middleware/StartSession.php | 10 +- src/Illuminate/Session/Store.php | 10 +- src/Illuminate/Support/Arr.php | 6 +- src/Illuminate/Support/ClassLoader.php | 2 +- src/Illuminate/Support/Collection.php | 10 +- src/Illuminate/Support/Facades/Cookie.php | 2 +- src/Illuminate/Support/HtmlString.php | 6 +- src/Illuminate/Support/Manager.php | 2 +- src/Illuminate/Support/MessageBag.php | 4 +- src/Illuminate/Support/ServiceProvider.php | 4 +- src/Illuminate/Support/Str.php | 8 +- .../Support/Traits/CapsuleManagerTrait.php | 2 +- src/Illuminate/Support/helpers.php | 106 +++++++------- src/Illuminate/Translation/Translator.php | 8 +- .../Validation/DatabasePresenceVerifier.php | 2 +- src/Illuminate/Validation/Factory.php | 4 +- .../Validation/ValidatesWhenResolvedTrait.php | 4 +- src/Illuminate/Validation/Validator.php | 52 +++---- .../View/Compilers/BladeCompiler.php | 30 ++-- src/Illuminate/View/Compilers/Compiler.php | 2 +- src/Illuminate/View/Expression.php | 6 +- src/Illuminate/View/Factory.php | 4 +- src/Illuminate/View/FileViewFinder.php | 2 +- tests/Cache/CacheRateLimiterTest.php | 80 +++++----- .../Cookie/Middleware/EncryptCookiesTest.php | 4 +- tests/Database/DatabaseConnectorTest.php | 2 +- ...baseEloquentSoftDeletesIntegrationTest.php | 2 - .../DatabaseMigrationMakeCommandTest.php | 2 +- .../DatabaseMySqlSchemaGrammarTest.php | 2 +- tests/Database/DatabaseQueryBuilderTest.php | 4 +- tests/Http/HttpRequestTest.php | 2 +- tests/Queue/QueueDatabaseQueueTest.php | 4 +- tests/Routing/RoutingRouteTest.php | 12 +- tests/Support/SupportArrTest.php | 1 - tests/Support/SupportCollectionTest.php | 4 +- tests/Support/SupportHelpersTest.php | 2 +- 149 files changed, 669 insertions(+), 665 deletions(-) create mode 100644 .styleci.yml diff --git a/.php_cs b/.php_cs index ef755d9e71..5e950cd2ef 100644 --- a/.php_cs +++ b/.php_cs @@ -1,31 +1,43 @@ files() - ->in(__DIR__) - ->name('*.stub') - ->ignoreDotFiles(true) - ->ignoreVCS(true); +use Symfony\CS\Config\Config; +use Symfony\CS\FixerInterface; +use Symfony\CS\Finder\DefaultFinder; $fixers = [ - '-psr0', - '-php_closing_tag', 'blankline_after_open_tag', + 'braces', 'concat_without_spaces', 'double_arrow_multiline_whitespaces', 'duplicate_semicolon', + 'elseif', 'empty_return', + 'encoding', + 'eof_ending', 'extra_empty_lines', + 'function_call_space', + 'function_declaration', 'include', + 'indentation', + 'linefeed', 'join_function', + 'line_after_namespace', 'list_commas', + 'logical_not_operators_with_successor_space', + 'lowercase_constants', + 'lowercase_keywords', + 'method_argument_space', 'multiline_array_trailing_comma', + 'multiline_spaces_before_semicolon', + 'multiple_use', 'namespace_no_leading_whitespace', 'no_blank_lines_after_class_opening', 'no_empty_lines_after_phpdocs', 'object_operator', 'operators_spaces', + 'parenthesis', 'phpdoc_indent', + 'phpdoc_inline_tag', 'phpdoc_no_access', 'phpdoc_no_package', 'phpdoc_scalar', @@ -38,24 +50,24 @@ $fixers = [ 'remove_lines_between_uses', 'return', 'self_accessor', + 'short_array_syntax', + 'short_echo_tag', + 'short_tag', 'single_array_no_trailing_comma', 'single_blank_line_before_namespace', + 'single_line_after_imports', 'single_quote', 'spaces_before_semicolon', 'spaces_cast', 'standardize_not_equal', 'ternary_spaces', + 'trailing_spaces', 'trim_array_spaces', 'unalign_equals', 'unary_operators_spaces', + 'unused_use', + 'visibility', 'whitespacy_lines', - 'multiline_spaces_before_semicolon', - 'short_array_syntax', - 'short_echo_tag', ]; -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers($fixers) - ->finder($finder) - ->setUsingCache(true); +return Config::create()->level(FixerInterface::NONE_LEVEL)->fixers($fixers)->finder(DefaultFinder::create()->in(__DIR__)); diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000000..0285f1790d --- /dev/null +++ b/.styleci.yml @@ -0,0 +1 @@ +preset: laravel diff --git a/src/Illuminate/Auth/AuthManager.php b/src/Illuminate/Auth/AuthManager.php index 76d75dfd80..96129f83e2 100755 --- a/src/Illuminate/Auth/AuthManager.php +++ b/src/Illuminate/Auth/AuthManager.php @@ -29,9 +29,9 @@ class AuthManager extends Manager } if (method_exists($guard, 'setRequest')) { - $guard->setRequest($this->app->refresh('request', $guard, 'setRequest')); + $guard->setRequest($this->app->refresh('request', $guard, 'setRequest')); } - + return $guard; } diff --git a/src/Illuminate/Auth/DatabaseUserProvider.php b/src/Illuminate/Auth/DatabaseUserProvider.php index 91711424f5..e23a63fc8d 100755 --- a/src/Illuminate/Auth/DatabaseUserProvider.php +++ b/src/Illuminate/Auth/DatabaseUserProvider.php @@ -104,7 +104,7 @@ class DatabaseUserProvider implements UserProvider $query = $this->conn->table($this->table); foreach ($credentials as $key => $value) { - if (!Str::contains($key, 'password')) { + if (! Str::contains($key, 'password')) { $query->where($key, $value); } } diff --git a/src/Illuminate/Auth/EloquentUserProvider.php b/src/Illuminate/Auth/EloquentUserProvider.php index 4d45016021..2d55589b54 100755 --- a/src/Illuminate/Auth/EloquentUserProvider.php +++ b/src/Illuminate/Auth/EloquentUserProvider.php @@ -92,7 +92,7 @@ class EloquentUserProvider implements UserProvider $query = $this->createModel()->newQuery(); foreach ($credentials as $key => $value) { - if (!Str::contains($key, 'password')) { + if (! Str::contains($key, 'password')) { $query->where($key, $value); } } diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index cf49bf8d95..7784d4f7c0 100755 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -109,7 +109,7 @@ class Guard implements GuardContract */ public function check() { - return !is_null($this->user()); + return ! is_null($this->user()); } /** @@ -119,7 +119,7 @@ class Guard implements GuardContract */ public function guest() { - return !$this->check(); + return ! $this->check(); } /** @@ -136,7 +136,7 @@ class Guard implements GuardContract // If we have already retrieved the user for the current request we can just // return it back immediately. We do not want to pull the user data every // request into the method because that would tremendously slow an app. - if (!is_null($this->user)) { + if (! is_null($this->user)) { return $this->user; } @@ -147,7 +147,7 @@ class Guard implements GuardContract // request, and if one exists, attempt to retrieve the user using that. $user = null; - if (!is_null($id)) { + if (! is_null($id)) { $user = $this->provider->retrieveById($id); } @@ -156,7 +156,7 @@ class Guard implements GuardContract // the application. Once we have a user we can return it to the caller. $recaller = $this->getRecaller(); - if (is_null($user) && !is_null($recaller)) { + if (is_null($user) && ! is_null($recaller)) { $user = $this->getUserByRecaller($recaller); if ($user) { @@ -197,12 +197,12 @@ class Guard implements GuardContract */ protected function getUserByRecaller($recaller) { - if ($this->validRecaller($recaller) && !$this->tokenRetrievalAttempted) { + if ($this->validRecaller($recaller) && ! $this->tokenRetrievalAttempted) { $this->tokenRetrievalAttempted = true; list($id, $token) = explode('|', $recaller, 2); - $this->viaRemember = !is_null($user = $this->provider->retrieveByToken($id, $token)); + $this->viaRemember = ! is_null($user = $this->provider->retrieveByToken($id, $token)); return $user; } @@ -238,7 +238,7 @@ class Guard implements GuardContract */ protected function validRecaller($recaller) { - if (!is_string($recaller) || !Str::contains($recaller, '|')) { + if (! is_string($recaller) || ! Str::contains($recaller, '|')) { return false; } @@ -305,7 +305,7 @@ class Guard implements GuardContract */ public function onceBasic($field = 'email') { - if (!$this->once($this->getBasicCredentials($this->getRequest(), $field))) { + if (! $this->once($this->getBasicCredentials($this->getRequest(), $field))) { return $this->getBasicResponse(); } } @@ -319,7 +319,7 @@ class Guard implements GuardContract */ protected function attemptBasic(Request $request, $field) { - if (!$request->getUser()) { + if (! $request->getUser()) { return false; } @@ -387,7 +387,7 @@ class Guard implements GuardContract */ protected function hasValidCredentials($user, $credentials) { - return !is_null($user) && $this->provider->validateCredentials($user, $credentials); + return ! is_null($user) && $this->provider->validateCredentials($user, $credentials); } /** @@ -499,7 +499,7 @@ class Guard implements GuardContract */ public function onceUsingId($id) { - if (!is_null($user = $this->provider->retrieveById($id))) { + if (! is_null($user = $this->provider->retrieveById($id))) { $this->setUser($user); return true; @@ -546,7 +546,7 @@ class Guard implements GuardContract // listening for anytime a user signs out of this application manually. $this->clearUserDataFromStorage(); - if (!is_null($this->user)) { + if (! is_null($this->user)) { $this->refreshRememberToken($user); } @@ -611,7 +611,7 @@ class Guard implements GuardContract */ public function getCookieJar() { - if (!isset($this->cookie)) { + if (! isset($this->cookie)) { throw new RuntimeException('Cookie jar has not been set.'); } diff --git a/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php b/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php index 394add6215..db93cf97f3 100755 --- a/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php +++ b/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php @@ -112,7 +112,7 @@ class DatabaseTokenRepository implements TokenRepositoryInterface $token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first(); - return $token && !$this->tokenExpired($token); + return $token && ! $this->tokenExpired($token); } /** diff --git a/src/Illuminate/Auth/Passwords/PasswordBroker.php b/src/Illuminate/Auth/Passwords/PasswordBroker.php index 793f2bb2cd..9fe8e76ae2 100755 --- a/src/Illuminate/Auth/Passwords/PasswordBroker.php +++ b/src/Illuminate/Auth/Passwords/PasswordBroker.php @@ -112,7 +112,7 @@ class PasswordBroker implements PasswordBrokerContract return $this->mailer->send($view, compact('token', 'user'), function ($m) use ($user, $token, $callback) { $m->to($user->getEmailForPasswordReset()); - if (!is_null($callback)) { + if (! is_null($callback)) { call_user_func($callback, $m, $user, $token); } }); @@ -132,7 +132,7 @@ class PasswordBroker implements PasswordBrokerContract // the user is properly redirected having an error message on the post. $user = $this->validateReset($credentials); - if (!$user instanceof CanResetPasswordContract) { + if (! $user instanceof CanResetPasswordContract) { return $user; } @@ -160,11 +160,11 @@ class PasswordBroker implements PasswordBrokerContract return PasswordBrokerContract::INVALID_USER; } - if (!$this->validateNewPassword($credentials)) { + if (! $this->validateNewPassword($credentials)) { return PasswordBrokerContract::INVALID_PASSWORD; } - if (!$this->tokens->exists($user, $credentials['token'])) { + if (! $this->tokens->exists($user, $credentials['token'])) { return PasswordBrokerContract::INVALID_TOKEN; } @@ -233,7 +233,7 @@ class PasswordBroker implements PasswordBrokerContract $user = $this->users->retrieveByCredentials($credentials); - if ($user && !$user instanceof CanResetPasswordContract) { + if ($user && ! $user instanceof CanResetPasswordContract) { throw new UnexpectedValueException('User must implement CanResetPassword interface.'); } diff --git a/src/Illuminate/Bus/Dispatcher.php b/src/Illuminate/Bus/Dispatcher.php index ac2a931dbd..288d773d4a 100644 --- a/src/Illuminate/Bus/Dispatcher.php +++ b/src/Illuminate/Bus/Dispatcher.php @@ -235,7 +235,7 @@ class Dispatcher implements DispatcherContract, QueueingDispatcher, HandlerResol { $queue = call_user_func($this->queueResolver); - if (!$queue instanceof Queue) { + if (! $queue instanceof Queue) { throw new RuntimeException('Queue resolver did not return a Queue implementation.'); } diff --git a/src/Illuminate/Cache/DatabaseStore.php b/src/Illuminate/Cache/DatabaseStore.php index 5332ae928b..2f7bebff46 100755 --- a/src/Illuminate/Cache/DatabaseStore.php +++ b/src/Illuminate/Cache/DatabaseStore.php @@ -70,7 +70,7 @@ class DatabaseStore implements Store // If we have a cache record we will check the expiration time against current // time on the system and see if the record has expired. If it has, we will // remove the records from the database table so it isn't returned again. - if (!is_null($cache)) { + if (! is_null($cache)) { if (is_array($cache)) { $cache = (object) $cache; } @@ -157,7 +157,7 @@ class DatabaseStore implements Store $cache = $this->table()->where('key', $prefixed)->lockForUpdate()->first(); - if (!is_null($cache)) { + if (! is_null($cache)) { $current = $this->encrypter->decrypt($cache->value); if (is_numeric($current)) { diff --git a/src/Illuminate/Cache/MemcachedConnector.php b/src/Illuminate/Cache/MemcachedConnector.php index 2ff6c4d7c2..49f5cd8ba5 100755 --- a/src/Illuminate/Cache/MemcachedConnector.php +++ b/src/Illuminate/Cache/MemcachedConnector.php @@ -30,7 +30,7 @@ class MemcachedConnector $memcachedStatus = $memcached->getVersion(); - if (!is_array($memcachedStatus)) { + if (! is_array($memcachedStatus)) { throw new RuntimeException('No Memcached servers added.'); } diff --git a/src/Illuminate/Cache/RateLimiter.php b/src/Illuminate/Cache/RateLimiter.php index 2030e19c13..6a1e836d9f 100644 --- a/src/Illuminate/Cache/RateLimiter.php +++ b/src/Illuminate/Cache/RateLimiter.php @@ -6,86 +6,86 @@ use Illuminate\Contracts\Cache\Repository as Cache; class RateLimiter { - /** - * The cache store implementation. - * - * @var \Illuminate\Contracts\Cache\Repository - */ - protected $cache; + /** + * The cache store implementation. + * + * @var \Illuminate\Contracts\Cache\Repository + */ + protected $cache; - /** - * Create a new rate limiter instance. - * - * @param \Illuminate\Contracts\Cache\Repository $cache - * @return void - */ - public function __construct(Cache $cache) - { - $this->cache = $cache; - } + /** + * Create a new rate limiter instance. + * + * @param \Illuminate\Contracts\Cache\Repository $cache + * @return void + */ + public function __construct(Cache $cache) + { + $this->cache = $cache; + } - /** - * Determine if the given key has been "accessed" too many times. - * - * @param string $key - * @param int $maxAttempts - * @param int $decayMinutes - * @return bool - */ - public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1) - { - $attempts = $this->cache->get( - $key, 0 - ); + /** + * Determine if the given key has been "accessed" too many times. + * + * @param string $key + * @param int $maxAttempts + * @param int $decayMinutes + * @return bool + */ + public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1) + { + $attempts = $this->cache->get( + $key, 0 + ); - $lockedOut = $this->cache->has($key.':lockout'); + $lockedOut = $this->cache->has($key.':lockout'); - if ($attempts > $maxAttempts || $lockedOut) { - if ( ! $lockedOut) { - $this->cache->add($key.':lockout', time() + ($decayMinutes * 60), $decayMinutes); - } + if ($attempts > $maxAttempts || $lockedOut) { + if (! $lockedOut) { + $this->cache->add($key.':lockout', time() + ($decayMinutes * 60), $decayMinutes); + } - return true; - } + return true; + } - return false; - } + return false; + } - /** - * Increment the counter for a given key for a given decay time. - * - * @param string $key - * @param int $decayMinutes - * @return int - */ - public function hit($key, $decayMinutes = 1) - { + /** + * Increment the counter for a given key for a given decay time. + * + * @param string $key + * @param int $decayMinutes + * @return int + */ + public function hit($key, $decayMinutes = 1) + { $this->cache->add($key, 1, $decayMinutes); return (int) $this->cache->increment($key); - } + } - /** - * Clear the hits and lockout for the given key. - * - * @param string $key - * @return void - */ - public function clear($key) - { - $this->cache->forget($key); + /** + * Clear the hits and lockout for the given key. + * + * @param string $key + * @return void + */ + public function clear($key) + { + $this->cache->forget($key); - $this->cache->forget($key.':lockout'); - } + $this->cache->forget($key.':lockout'); + } - /** - * Get the number of seconds until the "key" is accessible again. - * - * @param string $key - * @return int - */ - public function availableIn($key) - { - return $this->cache->get($key.':lockout') - time(); - } + /** + * Get the number of seconds until the "key" is accessible again. + * + * @param string $key + * @return int + */ + public function availableIn($key) + { + return $this->cache->get($key.':lockout') - time(); + } } diff --git a/src/Illuminate/Cache/RedisStore.php b/src/Illuminate/Cache/RedisStore.php index 54f0ee9cfe..a12a916289 100755 --- a/src/Illuminate/Cache/RedisStore.php +++ b/src/Illuminate/Cache/RedisStore.php @@ -51,7 +51,7 @@ class RedisStore extends TaggableStore implements Store */ public function get($key) { - if (!is_null($value = $this->connection()->get($this->prefix.$key))) { + if (! is_null($value = $this->connection()->get($this->prefix.$key))) { return is_numeric($value) ? $value : unserialize($value); } } diff --git a/src/Illuminate/Cache/Repository.php b/src/Illuminate/Cache/Repository.php index 16919d497d..b2a9b16f61 100755 --- a/src/Illuminate/Cache/Repository.php +++ b/src/Illuminate/Cache/Repository.php @@ -82,7 +82,7 @@ class Repository implements CacheContract, ArrayAccess */ public function has($key) { - return !is_null($this->get($key)); + return ! is_null($this->get($key)); } /** @@ -135,7 +135,7 @@ class Repository implements CacheContract, ArrayAccess { $minutes = $this->getMinutes($minutes); - if (!is_null($minutes)) { + if (! is_null($minutes)) { $this->store->put($key, $value, $minutes); $this->fireCacheEvent('write', [$key, $value, $minutes]); @@ -192,7 +192,7 @@ class Repository implements CacheContract, ArrayAccess // If the item exists in the cache we will just return this immediately // otherwise we will execute the given Closure and cache the result // of that execution for the given number of minutes in storage. - if (!is_null($value = $this->get($key))) { + if (! is_null($value = $this->get($key))) { return $value; } @@ -225,7 +225,7 @@ class Repository implements CacheContract, ArrayAccess // If the item exists in the cache we will just return this immediately // otherwise we will execute the given Closure and cache the result // of that execution for the given number of minutes. It's easy. - if (!is_null($value = $this->get($key))) { + if (! is_null($value = $this->get($key))) { return $value; } diff --git a/src/Illuminate/Cache/TaggedCache.php b/src/Illuminate/Cache/TaggedCache.php index 218eef701b..96994ac52e 100644 --- a/src/Illuminate/Cache/TaggedCache.php +++ b/src/Illuminate/Cache/TaggedCache.php @@ -44,7 +44,7 @@ class TaggedCache implements Store */ public function has($key) { - return !is_null($this->get($key)); + return ! is_null($this->get($key)); } /** @@ -58,7 +58,7 @@ class TaggedCache implements Store { $value = $this->store->get($this->taggedItemKey($key)); - return !is_null($value) ? $value : value($default); + return ! is_null($value) ? $value : value($default); } /** @@ -73,7 +73,7 @@ class TaggedCache implements Store { $minutes = $this->getMinutes($minutes); - if (!is_null($minutes)) { + if (! is_null($minutes)) { $this->store->put($this->taggedItemKey($key), $value, $minutes); } } @@ -167,7 +167,7 @@ class TaggedCache implements Store // If the item exists in the cache we will just return this immediately // otherwise we will execute the given Closure and cache the result // of that execution for the given number of minutes in storage. - if (!is_null($value = $this->get($key))) { + if (! is_null($value = $this->get($key))) { return $value; } @@ -200,7 +200,7 @@ class TaggedCache implements Store // If the item exists in the cache we will just return this immediately // otherwise we will execute the given Closure and cache the result // of that execution for the given number of minutes. It's easy. - if (!is_null($value = $this->get($key))) { + if (! is_null($value = $this->get($key))) { return $value; } diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index fe2edf5a47..943868ef9d 100755 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -75,7 +75,7 @@ class Command extends SymfonyCommand $this->setDescription($this->description); - if (!isset($this->signature)) { + if (! isset($this->signature)) { $this->specifyParameters(); } } diff --git a/src/Illuminate/Console/ConfirmableTrait.php b/src/Illuminate/Console/ConfirmableTrait.php index de4e9f459a..acd859e2fb 100644 --- a/src/Illuminate/Console/ConfirmableTrait.php +++ b/src/Illuminate/Console/ConfirmableTrait.php @@ -29,7 +29,7 @@ trait ConfirmableTrait $confirmed = $this->confirm('Do you really wish to run this command? [y/N]'); - if (!$confirmed) { + if (! $confirmed) { $this->comment('Command Cancelled!'); return false; diff --git a/src/Illuminate/Console/GeneratorCommand.php b/src/Illuminate/Console/GeneratorCommand.php index 52ac823463..2dd703247c 100644 --- a/src/Illuminate/Console/GeneratorCommand.php +++ b/src/Illuminate/Console/GeneratorCommand.php @@ -132,7 +132,7 @@ abstract class GeneratorCommand extends Command */ protected function makeDirectory($path) { - if (!$this->files->isDirectory(dirname($path))) { + if (! $this->files->isDirectory(dirname($path))) { $this->files->makeDirectory(dirname($path), 0777, true, true); } } diff --git a/src/Illuminate/Console/Parser.php b/src/Illuminate/Console/Parser.php index 78751ef49e..22f690537e 100644 --- a/src/Illuminate/Console/Parser.php +++ b/src/Illuminate/Console/Parser.php @@ -53,7 +53,7 @@ class Parser $options = []; foreach ($tokens as $token) { - if (!Str::startsWith($token, '--')) { + if (! Str::startsWith($token, '--')) { $arguments[] = static::parseArgument($token); } else { $options[] = static::parseOption(ltrim($token, '-')); diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index e658f761bb..fec8c92ee9 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -34,7 +34,7 @@ class CallbackEvent extends Event $this->callback = $callback; $this->parameters = $parameters; - if (!is_string($this->callback) && !is_callable($this->callback)) { + if (! is_string($this->callback) && ! is_callable($this->callback)) { throw new InvalidArgumentException( 'Invalid scheduled callback event. Must be string or callable.' ); @@ -85,7 +85,7 @@ class CallbackEvent extends Event */ public function withoutOverlapping() { - if (!isset($this->description)) { + if (! isset($this->description)) { throw new LogicException( "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'." ); diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index cf8a1ece4c..60578cfd11 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -231,7 +231,7 @@ class Event */ public function isDue(Application $app) { - if (!$this->runsInMaintenanceMode() && $app->isDownForMaintenance()) { + if (! $this->runsInMaintenanceMode() && $app->isDownForMaintenance()) { return false; } @@ -264,7 +264,7 @@ class Event */ protected function filtersPass(Application $app) { - if (($this->filter && !$app->call($this->filter)) || + if (($this->filter && ! $app->call($this->filter)) || $this->reject && $app->call($this->reject)) { return false; } diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index ff53475dfe..d4cd0c4193 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -187,7 +187,7 @@ class Container implements ArrayAccess, ContainerContract // If the factory is not a Closure, it means it is just a class name which is // is bound into this container to the abstract type and we will just wrap // it up inside a Closure to make things more convenient when extending. - if (!$concrete instanceof Closure) { + if (! $concrete instanceof Closure) { $concrete = $this->getClosure($abstract, $concrete); } @@ -239,7 +239,7 @@ class Container implements ArrayAccess, ContainerContract */ public function bindIf($abstract, $concrete = null, $shared = false) { - if (!$this->bound($abstract)) { + if (! $this->bound($abstract)) { $this->bind($abstract, $concrete, $shared); } } @@ -356,7 +356,7 @@ class Container implements ArrayAccess, ContainerContract $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); foreach ($tags as $tag) { - if (!isset($this->tags[$tag])) { + if (! isset($this->tags[$tag])) { $this->tags[$tag] = []; } @@ -510,7 +510,7 @@ class Container implements ArrayAccess, ContainerContract */ protected function isCallableWithAtSign($callback) { - if (!is_string($callback)) { + if (! is_string($callback)) { return false; } @@ -657,14 +657,14 @@ class Container implements ArrayAccess, ContainerContract */ protected function getConcrete($abstract) { - if (!is_null($concrete = $this->getContextualConcrete($abstract))) { + if (! is_null($concrete = $this->getContextualConcrete($abstract))) { return $concrete; } // If we don't have a registered resolver or concrete for the type, we'll just // assume each type is a concrete name and will attempt to resolve it as is // since the container should be able to resolve concretes automatically. - if (!isset($this->bindings[$abstract])) { + if (! isset($this->bindings[$abstract])) { if ($this->missingLeadingSlash($abstract) && isset($this->bindings['\\'.$abstract])) { $abstract = '\\'.$abstract; @@ -738,7 +738,7 @@ class Container implements ArrayAccess, ContainerContract // If the type is not instantiable, the developer is attempting to resolve // an abstract type such as an Interface of Abstract Class and there is // no binding registered for the abstractions so we need to bail out. - if (!$reflector->isInstantiable()) { + if (! $reflector->isInstantiable()) { $message = "Target [$concrete] is not instantiable."; throw new BindingResolutionContractException($message); @@ -951,7 +951,7 @@ class Container implements ArrayAccess, ContainerContract $expected = $function->getParameters()[0]; - if (!$expected->getClass()) { + if (! $expected->getClass()) { return; } @@ -1169,7 +1169,7 @@ class Container implements ArrayAccess, ContainerContract // If the value is not a Closure, we will make it one. This simply gives // more "drop-in" replacement functionality for the Pimple which this // container's simplest functions are base modeled and built after. - if (!$value instanceof Closure) { + if (! $value instanceof Closure) { $value = function () use ($value) { return $value; }; diff --git a/src/Illuminate/Contracts/Support/Htmlable.php b/src/Illuminate/Contracts/Support/Htmlable.php index 93d9c72329..32f643a14f 100644 --- a/src/Illuminate/Contracts/Support/Htmlable.php +++ b/src/Illuminate/Contracts/Support/Htmlable.php @@ -5,7 +5,7 @@ namespace Illuminate\Contracts\Support; interface Htmlable { /** - * Get content as a string of HTML + * Get content as a string of HTML. * * @return string */ diff --git a/src/Illuminate/Cookie/CookieJar.php b/src/Illuminate/Cookie/CookieJar.php index 15ff637f37..fbfcfefea1 100755 --- a/src/Illuminate/Cookie/CookieJar.php +++ b/src/Illuminate/Cookie/CookieJar.php @@ -87,7 +87,7 @@ class CookieJar implements JarContract */ public function hasQueued($key) { - return !is_null($this->queued($key)); + return ! is_null($this->queued($key)); } /** diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php index e59a1fc07c..22ef080509 100755 --- a/src/Illuminate/Database/Connection.php +++ b/src/Illuminate/Database/Connection.php @@ -733,7 +733,7 @@ class Connection implements ConnectionInterface $this->events->fire('illuminate.query', [$query, $bindings, $time, $this->getName()]); } - if (!$this->loggingQueries) { + if (! $this->loggingQueries) { return; } diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index faa7172f57..24a2e4041b 100755 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -164,7 +164,7 @@ class ConnectionFactory */ public function createConnector(array $config) { - if (!isset($config['driver'])) { + if (! isset($config['driver'])) { throw new InvalidArgumentException('A driver must be specified.'); } diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php index 2585a1e31e..f70232ff04 100755 --- a/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -33,7 +33,7 @@ class MySqlConnector extends Connector implements ConnectorInterface $charset = $config['charset']; $names = "set names '$charset'". - (!is_null($collation) ? " collate '$collation'" : ''); + (! is_null($collation) ? " collate '$collation'" : ''); $connection->prepare($names)->execute(); @@ -81,7 +81,7 @@ class MySqlConnector extends Connector implements ConnectorInterface */ protected function configHasSocket(array $config) { - return isset($config['unix_socket']) && !empty($config['unix_socket']); + return isset($config['unix_socket']) && ! empty($config['unix_socket']); } /** diff --git a/src/Illuminate/Database/Console/Migrations/MigrateCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateCommand.php index 6b36d369c8..920d417df8 100755 --- a/src/Illuminate/Database/Console/Migrations/MigrateCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateCommand.php @@ -51,7 +51,7 @@ class MigrateCommand extends BaseCommand */ public function fire() { - if (!$this->confirmToProceed()) { + if (! $this->confirmToProceed()) { return; } @@ -65,7 +65,7 @@ class MigrateCommand extends BaseCommand // Next, we will check to see if a path option has been defined. If it has // we will use the path relative to the root of this installation folder // so that migrations may be run for any path within the applications. - if (!is_null($path = $this->input->getOption('path'))) { + if (! is_null($path = $this->input->getOption('path'))) { $path = $this->laravel->basePath().'/'.$path; } else { $path = $this->getMigrationPath(); @@ -97,7 +97,7 @@ class MigrateCommand extends BaseCommand { $this->migrator->setConnection($this->input->getOption('database')); - if (!$this->migrator->repositoryExists()) { + if (! $this->migrator->repositoryExists()) { $options = ['--database' => $this->input->getOption('database')]; $this->call('migrate:install', $options); diff --git a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php index 883ae8160d..7fef3b9e18 100644 --- a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php @@ -69,7 +69,7 @@ class MigrateMakeCommand extends BaseCommand $create = $this->input->getOption('create'); - if (!$table && is_string($create)) { + if (! $table && is_string($create)) { $table = $create; } @@ -105,7 +105,7 @@ class MigrateMakeCommand extends BaseCommand */ protected function getMigrationPath() { - if (!is_null($targetPath = $this->input->getOption('path'))) { + if (! is_null($targetPath = $this->input->getOption('path'))) { return $this->laravel->basePath().'/'.$targetPath; } diff --git a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php index 6118aa88ce..cbec9afaa4 100755 --- a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php @@ -31,7 +31,7 @@ class RefreshCommand extends Command */ public function fire() { - if (!$this->confirmToProceed()) { + if (! $this->confirmToProceed()) { return; } diff --git a/src/Illuminate/Database/Console/Migrations/ResetCommand.php b/src/Illuminate/Database/Console/Migrations/ResetCommand.php index 7f4f656c22..8871d3d02b 100755 --- a/src/Illuminate/Database/Console/Migrations/ResetCommand.php +++ b/src/Illuminate/Database/Console/Migrations/ResetCommand.php @@ -52,13 +52,13 @@ class ResetCommand extends Command */ public function fire() { - if (!$this->confirmToProceed()) { + if (! $this->confirmToProceed()) { return; } $this->migrator->setConnection($this->input->getOption('database')); - if (!$this->migrator->repositoryExists()) { + if (! $this->migrator->repositoryExists()) { $this->output->writeln('Migration table not found.'); return; diff --git a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php index 8f0b57afa8..a341b4fecb 100755 --- a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php @@ -52,7 +52,7 @@ class RollbackCommand extends Command */ public function fire() { - if (!$this->confirmToProceed()) { + if (! $this->confirmToProceed()) { return; } diff --git a/src/Illuminate/Database/Console/Migrations/StatusCommand.php b/src/Illuminate/Database/Console/Migrations/StatusCommand.php index 5c07e87bce..fd375a6620 100644 --- a/src/Illuminate/Database/Console/Migrations/StatusCommand.php +++ b/src/Illuminate/Database/Console/Migrations/StatusCommand.php @@ -47,7 +47,7 @@ class StatusCommand extends BaseCommand */ public function fire() { - if (!$this->migrator->repositoryExists()) { + if (! $this->migrator->repositoryExists()) { return $this->error('No migrations found.'); } diff --git a/src/Illuminate/Database/Console/Seeds/SeedCommand.php b/src/Illuminate/Database/Console/Seeds/SeedCommand.php index 17d3dc2ace..f74164be6c 100644 --- a/src/Illuminate/Database/Console/Seeds/SeedCommand.php +++ b/src/Illuminate/Database/Console/Seeds/SeedCommand.php @@ -52,7 +52,7 @@ class SeedCommand extends Command */ public function fire() { - if (!$this->confirmToProceed()) { + if (! $this->confirmToProceed()) { return; } diff --git a/src/Illuminate/Database/DatabaseManager.php b/src/Illuminate/Database/DatabaseManager.php index 1896797348..1a846e07be 100755 --- a/src/Illuminate/Database/DatabaseManager.php +++ b/src/Illuminate/Database/DatabaseManager.php @@ -63,7 +63,7 @@ class DatabaseManager implements ConnectionResolverInterface // If we haven't created this connection, we'll create it based on the config // provided in the application. Once we've created the connections we will // set the "fetch mode" for PDO which determines the query return types. - if (!isset($this->connections[$name])) { + if (! isset($this->connections[$name])) { $connection = $this->makeConnection($name); $this->setPdoForType($connection, $type); @@ -124,7 +124,7 @@ class DatabaseManager implements ConnectionResolverInterface { $this->disconnect($name = $name ?: $this->getDefaultConnection()); - if (!isset($this->connections[$name])) { + if (! isset($this->connections[$name])) { return $this->connection($name); } diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index a3ae8bf39c..012ea1e62d 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -122,7 +122,7 @@ class Builder if (count($result) == count(array_unique($id))) { return $result; } - } elseif (!is_null($result)) { + } elseif (! is_null($result)) { return $result; } @@ -150,7 +150,7 @@ class Builder */ public function firstOrFail($columns = ['*']) { - if (!is_null($model = $this->first($columns))) { + if (! is_null($model = $this->first($columns))) { return $model; } @@ -351,7 +351,7 @@ class Builder */ protected function addUpdatedAtColumn(array $values) { - if (!$this->model->usesTimestamps()) { + if (! $this->model->usesTimestamps()) { return $values; } @@ -804,7 +804,7 @@ class Builder foreach (explode('.', $name) as $segment) { $progress[] = $segment; - if (!isset($results[$last = implode('.', $progress)])) { + if (! isset($results[$last = implode('.', $progress)])) { $results[$last] = function () {}; } } diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index 7987437fc2..d54e5a0984 100755 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -137,7 +137,7 @@ class Collection extends BaseCollection $dictionary = $this->getDictionary($items); foreach ($this->items as $item) { - if (!isset($dictionary[$item->getKey()])) { + if (! isset($dictionary[$item->getKey()])) { $diff->add($item); } } @@ -174,7 +174,7 @@ class Collection extends BaseCollection */ public function unique($key = null) { - if (!is_null($key)) { + if (! is_null($key)) { return parent::unique($key); } diff --git a/src/Illuminate/Database/Eloquent/FactoryBuilder.php b/src/Illuminate/Database/Eloquent/FactoryBuilder.php index 15e509642f..bee35c9638 100644 --- a/src/Illuminate/Database/Eloquent/FactoryBuilder.php +++ b/src/Illuminate/Database/Eloquent/FactoryBuilder.php @@ -123,7 +123,7 @@ class FactoryBuilder protected function makeInstance(array $attributes = []) { return Model::unguarded(function () use ($attributes) { - if (!isset($this->definitions[$this->class][$this->name])) { + if (! isset($this->definitions[$this->class][$this->name])) { throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}]."); } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index ab98a47f69..1b6f58af97 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -287,7 +287,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab { $class = get_class($this); - if (!isset(static::$booted[$class])) { + if (! isset(static::$booted[$class])) { static::$booted[$class] = true; $this->fireModelEvent('booting', false); @@ -351,7 +351,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public static function hasGlobalScope($scope) { - return !is_null(static::getGlobalScope($scope)); + return ! is_null(static::getGlobalScope($scope)); } /** @@ -454,7 +454,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ protected function fillableFromArray(array $attributes) { - if (count($this->fillable) > 0 && !static::$unguarded) { + if (count($this->fillable) > 0 && ! static::$unguarded) { return array_intersect_key($attributes, array_flip($this->fillable)); } @@ -574,7 +574,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public static function firstOrCreate(array $attributes) { - if (!is_null($instance = static::where($attributes)->first())) { + if (! is_null($instance = static::where($attributes)->first())) { return $instance; } @@ -589,7 +589,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public static function firstOrNew(array $attributes) { - if (!is_null($instance = static::where($attributes)->first())) { + if (! is_null($instance = static::where($attributes)->first())) { return $instance; } @@ -676,7 +676,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public static function findOrNew($id, $columns = ['*']) { - if (!is_null($model = static::find($id, $columns))) { + if (! is_null($model = static::find($id, $columns))) { return $model; } @@ -691,7 +691,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public function fresh(array $with = []) { - if (!$this->exists) { + if (! $this->exists) { return; } @@ -1060,10 +1060,10 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab $caller = Arr::first(debug_backtrace(false), function ($key, $trace) use ($self) { $caller = $trace['function']; - return !in_array($caller, Model::$manyMethods) && $caller != $self; + return ! in_array($caller, Model::$manyMethods) && $caller != $self; }); - return !is_null($caller) ? $caller['function'] : null; + return ! is_null($caller) ? $caller['function'] : null; } /** @@ -1282,7 +1282,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public static function flushEventListeners() { - if (!isset(static::$dispatcher)) { + if (! isset(static::$dispatcher)) { return; } @@ -1400,7 +1400,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab { $query = $this->newQuery(); - if (!$this->exists) { + if (! $this->exists) { return $query->{$method}($column, $amount); } @@ -1432,7 +1432,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public function update(array $attributes = []) { - if (!$this->exists) { + if (! $this->exists) { return $this->newQuery()->update($attributes); } @@ -1446,7 +1446,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public function push() { - if (!$this->save()) { + if (! $this->save()) { return false; } @@ -1458,7 +1458,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab ? $models->all() : [$models]; foreach (array_filter($models) as $model) { - if (!$model->push()) { + if (! $model->push()) { return false; } } @@ -1665,7 +1665,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ protected function fireModelEvent($event, $halt = true) { - if (!isset(static::$dispatcher)) { + if (! isset(static::$dispatcher)) { return true; } @@ -1713,7 +1713,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public function touch() { - if (!$this->timestamps) { + if (! $this->timestamps) { return false; } @@ -1731,11 +1731,11 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab { $time = $this->freshTimestamp(); - if (!$this->isDirty(static::UPDATED_AT)) { + if (! $this->isDirty(static::UPDATED_AT)) { $this->setUpdatedAt($time); } - if (!$this->exists && !$this->isDirty(static::CREATED_AT)) { + if (! $this->exists && ! $this->isDirty(static::CREATED_AT)) { $this->setCreatedAt($time); } } @@ -2288,7 +2288,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab return false; } - return empty($this->fillable) && !Str::startsWith($key, '_'); + return empty($this->fillable) && ! Str::startsWith($key, '_'); } /** @@ -2320,7 +2320,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ protected function removeTableFromKey($key) { - if (!Str::contains($key, '.')) { + if (! Str::contains($key, '.')) { return $key; } @@ -2415,7 +2415,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab // to a DateTime / Carbon instance. This is so we will get some consistent // formatting while accessing attributes vs. arraying / JSONing a model. foreach ($this->getDates() as $key) { - if (!isset($attributes[$key])) { + if (! isset($attributes[$key])) { continue; } @@ -2430,7 +2430,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab // the mutator for the attribute. We cache off every mutated attributes so // we don't have to constantly check on attributes that actually change. foreach ($mutatedAttributes as $key) { - if (!array_key_exists($key, $attributes)) { + if (! array_key_exists($key, $attributes)) { continue; } @@ -2443,7 +2443,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab // the values to their appropriate type. If the attribute has a mutator we // will not perform the cast on those attributes to avoid any confusion. foreach ($this->casts as $key => $value) { - if (!array_key_exists($key, $attributes) || + if (! array_key_exists($key, $attributes) || in_array($key, $mutatedAttributes)) { continue; } @@ -2480,7 +2480,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ protected function getArrayableAppends() { - if (!count($this->appends)) { + if (! count($this->appends)) { return []; } @@ -2607,7 +2607,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab // instance on retrieval, which makes it quite convenient to work with // date fields without having to create a mutator for each property. elseif (in_array($key, $this->getDates())) { - if (!is_null($value)) { + if (! is_null($value)) { return $this->asDateTime($value); } } @@ -2663,7 +2663,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab { $relations = $this->$method(); - if (!$relations instanceof Relation) { + if (! $relations instanceof Relation) { throw new LogicException('Relationship method must return an object of type ' .'Illuminate\Database\Eloquent\Relations\Relation'); } @@ -3029,7 +3029,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab return count($dirty) > 0; } - if (!is_array($attributes)) { + if (! is_array($attributes)) { $attributes = func_get_args(); } @@ -3052,10 +3052,10 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab $dirty = []; foreach ($this->attributes as $key => $value) { - if (!array_key_exists($key, $this->original)) { + if (! array_key_exists($key, $this->original)) { $dirty[$key] = $value; } elseif ($value !== $this->original[$key] && - !$this->originalIsNumericallyEquivalent($key)) { + ! $this->originalIsNumericallyEquivalent($key)) { $dirty[$key] = $value; } } @@ -3252,7 +3252,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab { $class = get_class($this); - if (!isset(static::$mutatorCache[$class])) { + if (! isset(static::$mutatorCache[$class])) { static::cacheMutatedAttributes($class); } @@ -3363,7 +3363,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab public function __isset($key) { return (isset($this->attributes[$key]) || isset($this->relations[$key])) || - ($this->hasGetMutator($key) && !is_null($this->getAttributeValue($key))); + ($this->hasGetMutator($key) && ! is_null($this->getAttributeValue($key))); } /** diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php index 0c42e62ff0..5fa26a4fb9 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php @@ -154,7 +154,7 @@ class BelongsTo extends Relation // to query for via the eager loading query. We will add them to an array then // execute a "where in" statement to gather up all of those related records. foreach ($models as $model) { - if (!is_null($value = $model->{$this->foreignKey})) { + if (! is_null($value = $model->{$this->foreignKey})) { $keys[] = $value; } } diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 8408a4dbe0..ada59104e5 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -151,7 +151,7 @@ class BelongsToMany extends Relation */ public function firstOrFail($columns = ['*']) { - if (!is_null($model = $this->first($columns))) { + if (! is_null($model = $this->first($columns))) { return $model; } @@ -782,7 +782,7 @@ class BelongsToMany extends Relation $results = []; foreach ($records as $id => $attributes) { - if (!is_array($attributes)) { + if (! is_array($attributes)) { list($id, $attributes) = [$attributes, []]; } @@ -808,7 +808,7 @@ class BelongsToMany extends Relation // If the ID is not in the list of existing pivot IDs, we will insert a new pivot // record, otherwise, we will just update this existing record on this joining // table, so that the developers will easily update these records pain free. - if (!in_array($id, $current)) { + if (! in_array($id, $current)) { $this->attach($id, $attributes, $touch); $changes['attached'][] = (int) $id; @@ -968,7 +968,7 @@ class BelongsToMany extends Relation { $fresh = $this->parent->freshTimestamp(); - if (!$exists && $this->hasPivotColumn($this->createdAt())) { + if (! $exists && $this->hasPivotColumn($this->createdAt())) { $record[$this->createdAt()] = $fresh; } diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index a02f469a37..bfc2ceff17 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -61,7 +61,7 @@ class MorphTo extends BelongsTo */ public function getResults() { - if (!$this->otherKey) { + if (! $this->otherKey) { return; } diff --git a/src/Illuminate/Database/Eloquent/SoftDeletes.php b/src/Illuminate/Database/Eloquent/SoftDeletes.php index 3250d884e7..128dc69a74 100644 --- a/src/Illuminate/Database/Eloquent/SoftDeletes.php +++ b/src/Illuminate/Database/Eloquent/SoftDeletes.php @@ -98,7 +98,7 @@ trait SoftDeletes */ public function trashed() { - return !is_null($this->{$this->getDeletedAtColumn()}); + return ! is_null($this->{$this->getDeletedAtColumn()}); } /** diff --git a/src/Illuminate/Database/Migrations/MigrationCreator.php b/src/Illuminate/Database/Migrations/MigrationCreator.php index e903c0f157..beacfe16cc 100755 --- a/src/Illuminate/Database/Migrations/MigrationCreator.php +++ b/src/Illuminate/Database/Migrations/MigrationCreator.php @@ -96,7 +96,7 @@ class MigrationCreator // Here we will replace the table place-holders with the table specified by // the developer, which is useful for quickly creating a tables creation // or update migration from the console instead of typing it manually. - if (!is_null($table)) { + if (! is_null($table)) { $stub = str_replace('DummyTable', $table, $stub); } diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php index 7ea99922b7..94bd547b50 100755 --- a/src/Illuminate/Database/Migrations/Migrator.php +++ b/src/Illuminate/Database/Migrations/Migrator.php @@ -364,7 +364,7 @@ class Migrator */ public function setConnection($name) { - if (!is_null($name)) { + if (! is_null($name)) { $this->resolver->setDefaultConnection($name); } diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index b713060a9b..aa73b98b5b 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -465,7 +465,7 @@ class Builder // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. - if (!in_array(strtolower($operator), $this->operators, true)) { + if (! in_array(strtolower($operator), $this->operators, true)) { list($value, $operator) = [$operator, '=']; } @@ -490,7 +490,7 @@ class Builder $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); - if (!$value instanceof Expression) { + if (! $value instanceof Expression) { $this->addBinding($value, 'where'); } @@ -1050,7 +1050,7 @@ class Builder $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); - if (!$value instanceof Expression) { + if (! $value instanceof Expression) { $this->addBinding($value, 'having'); } @@ -1386,7 +1386,7 @@ class Builder */ protected function runSelect() { - return $this->connection->select($this->toSql(), $this->getBindings(), !$this->useWritePdo); + return $this->connection->select($this->toSql(), $this->getBindings(), ! $this->useWritePdo); } /** @@ -1599,7 +1599,7 @@ class Builder */ public function count($columns = '*') { - if (!is_array($columns)) { + if (! is_array($columns)) { $columns = [$columns]; } @@ -1705,7 +1705,7 @@ class Builder // Since every insert gets treated like a batch insert, we will make sure the // bindings are structured in a way that is convenient for building these // inserts statements by verifying the elements are actually an array. - if (!is_array(reset($values))) { + if (! is_array(reset($values))) { $values = [$values]; } @@ -1816,7 +1816,7 @@ class Builder // If an ID is passed to the method, we will set the where clause to check // the ID to allow developers to simply and quickly remove a single row // from their database without manually specifying the where clauses. - if (!is_null($id)) { + if (! is_null($id)) { $this->where('id', '=', $id); } @@ -1870,7 +1870,7 @@ class Builder protected function cleanBindings(array $bindings) { return array_values(array_filter($bindings, function ($binding) { - return !$binding instanceof Expression; + return ! $binding instanceof Expression; })); } @@ -1916,7 +1916,7 @@ class Builder */ public function setBindings(array $bindings, $type = 'where') { - if (!array_key_exists($type, $this->bindings)) { + if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } @@ -1936,7 +1936,7 @@ class Builder */ public function addBinding($value, $type = 'where') { - if (!array_key_exists($type, $this->bindings)) { + if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index 6c15216a97..9926f567ee 100755 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -56,7 +56,7 @@ class Grammar extends BaseGrammar // To compile the query, we'll spin through each component of the query and // see if that component exists. If it does we'll just call the compiler // function for the component which is responsible for making the SQL. - if (!is_null($query->$component)) { + if (! is_null($query->$component)) { $method = 'compile'.ucfirst($component); $sql[$component] = $this->$method($query, $query->$component); @@ -99,7 +99,7 @@ class Grammar extends BaseGrammar // If the query is actually performing an aggregating select, we will let that // compiler handle the building of the select clauses, as it will need some // more syntax that is best handled by that function to keep things neat. - if (!is_null($query->aggregate)) { + if (! is_null($query->aggregate)) { return; } @@ -179,7 +179,7 @@ class Grammar extends BaseGrammar if ($clause['where']) { if ($clause['operator'] === 'in' || $clause['operator'] === 'not in') { - $second = '('.join(', ', array_fill(0, $clause['second'], '?')).')'; + $second = '('.implode(', ', array_fill(0, $clause['second'], '?')).')'; } else { $second = '?'; } @@ -625,7 +625,7 @@ class Grammar extends BaseGrammar // basic routine regardless of an amount of records given to us to insert. $table = $this->wrapTable($query->from); - if (!is_array(reset($values))) { + if (! is_array(reset($values))) { $values = [$values]; } diff --git a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php index 5351d32261..6927d1637b 100755 --- a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php @@ -84,7 +84,7 @@ class PostgresGrammar extends Grammar */ protected function compileUpdateFrom(Builder $query) { - if (!isset($query->joins)) { + if (! isset($query->joins)) { return ''; } @@ -112,7 +112,7 @@ class PostgresGrammar extends Grammar { $baseWhere = $this->compileWheres($query); - if (!isset($query->joins)) { + if (! isset($query->joins)) { return $baseWhere; } diff --git a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php index fbcb71a816..ba0dc2a346 100755 --- a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php @@ -31,7 +31,7 @@ class SQLiteGrammar extends Grammar // basic routine regardless of an amount of records given to us to insert. $table = $this->wrapTable($query->from); - if (!is_array(reset($values))) { + if (! is_array(reset($values))) { $values = [$values]; } diff --git a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php index b7207e6664..9a33ec1d5c 100755 --- a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php @@ -46,7 +46,7 @@ class SqlServerGrammar extends Grammar */ protected function compileColumns(Builder $query, $columns) { - if (!is_null($query->aggregate)) { + if (! is_null($query->aggregate)) { return; } @@ -77,7 +77,7 @@ class SqlServerGrammar extends Grammar return $from.' '.$query->lock; } - if (!is_null($query->lock)) { + if (! is_null($query->lock)) { return $from.' with(rowlock,'.($query->lock ? 'updlock,' : '').'holdlock)'; } @@ -96,7 +96,7 @@ class SqlServerGrammar extends Grammar // An ORDER BY clause is required to make this offset query work, so if one does // not exist we'll just create a dummy clause to trick the database and so it // does not complain about the queries for not having an "order by" clause. - if (!isset($components['orders'])) { + if (! isset($components['orders'])) { $components['orders'] = 'order by (select 0)'; } diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index d5fcb20cdc..0ca02df10d 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -58,7 +58,7 @@ class Blueprint { $this->table = $table; - if (!is_null($callback)) { + if (! is_null($callback)) { $callback($this); } } @@ -97,7 +97,7 @@ class Blueprint $method = 'compile'.ucfirst($command->name); if (method_exists($grammar, $method)) { - if (!is_null($sql = $grammar->$method($this, $command, $connection))) { + if (! is_null($sql = $grammar->$method($this, $command, $connection))) { $statements = array_merge($statements, (array) $sql); } } @@ -113,11 +113,11 @@ class Blueprint */ protected function addImpliedCommands() { - if (count($this->getAddedColumns()) > 0 && !$this->creating()) { + if (count($this->getAddedColumns()) > 0 && ! $this->creating()) { array_unshift($this->commands, $this->createCommand('add')); } - if (count($this->getChangedColumns()) > 0 && !$this->creating()) { + if (count($this->getChangedColumns()) > 0 && ! $this->creating()) { array_unshift($this->commands, $this->createCommand('change')); } @@ -378,7 +378,7 @@ class Blueprint { return $this->unsignedInteger($column, true); } - + /** * Create a new auto-incrementing small integer (2-byte) column on the table. * @@ -994,7 +994,7 @@ class Blueprint public function getAddedColumns() { return array_filter($this->columns, function ($column) { - return !$column->change; + return ! $column->change; }); } @@ -1006,7 +1006,7 @@ class Blueprint public function getChangedColumns() { return array_filter($this->columns, function ($column) { - return !!$column->change; + return ! ! $column->change; }); } } diff --git a/src/Illuminate/Database/Schema/Builder.php b/src/Illuminate/Database/Schema/Builder.php index 1571c2dcac..5e10b424bb 100755 --- a/src/Illuminate/Database/Schema/Builder.php +++ b/src/Illuminate/Database/Schema/Builder.php @@ -81,7 +81,7 @@ class Builder $tableColumns = array_map('strtolower', $this->getColumnListing($table)); foreach ($columns as $column) { - if (!in_array(strtolower($column), $tableColumns)) { + if (! in_array(strtolower($column), $tableColumns)) { return false; } } diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index 22594655b8..a5c638fc34 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -97,11 +97,11 @@ abstract class Grammar extends BaseGrammar // Once we have the basic foreign key creation statement constructed we can // build out the syntax for what should happen on an update or delete of // the affected columns, which will get something like "cascade", etc. - if (!is_null($command->onDelete)) { + if (! is_null($command->onDelete)) { $sql .= " on delete {$command->onDelete}"; } - if (!is_null($command->onUpdate)) { + if (! is_null($command->onUpdate)) { $sql .= " on update {$command->onUpdate}"; } @@ -322,7 +322,7 @@ abstract class Grammar extends BaseGrammar // Doctrine column definitions, which is necessasry because Laravel and Doctrine // use some different terminology for various column attributes on the tables. foreach ($fluent->getAttributes() as $key => $value) { - if (!is_null($option = $this->mapFluentOptionToDoctrine($key))) { + if (! is_null($option = $this->mapFluentOptionToDoctrine($key))) { if (method_exists($column, $method = 'set'.ucfirst($option))) { $column->{$method}($this->mapFluentValueToDoctrine($option, $value)); } @@ -446,6 +446,6 @@ abstract class Grammar extends BaseGrammar */ protected function mapFluentValueToDoctrine($option, $value) { - return $option == 'notnull' ? !$value : $value; + return $option == 'notnull' ? ! $value : $value; } } diff --git a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php index 66a2fee2ab..8e076e8835 100755 --- a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -80,13 +80,13 @@ class MySqlGrammar extends Grammar { if (isset($blueprint->charset)) { $sql .= ' default character set '.$blueprint->charset; - } elseif (!is_null($charset = $connection->getConfig('charset'))) { + } elseif (! is_null($charset = $connection->getConfig('charset'))) { $sql .= ' default character set '.$charset; } if (isset($blueprint->collation)) { $sql .= ' collate '.$blueprint->collation; - } elseif (!is_null($collation = $connection->getConfig('collation'))) { + } elseif (! is_null($collation = $connection->getConfig('collation'))) { $sql .= ' collate '.$collation; } @@ -526,7 +526,7 @@ class MySqlGrammar extends Grammar */ protected function typeTimestamp(Fluent $column) { - if (!$column->nullable && $column->default === null) { + if (! $column->nullable && $column->default === null) { return 'timestamp default 0'; } @@ -541,7 +541,7 @@ class MySqlGrammar extends Grammar */ protected function typeTimestampTz(Fluent $column) { - if (!$column->nullable && $column->default === null) { + if (! $column->nullable && $column->default === null) { return 'timestamp default 0'; } @@ -582,7 +582,7 @@ class MySqlGrammar extends Grammar */ protected function modifyCharset(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->charset)) { + if (! is_null($column->charset)) { return ' character set '.$column->charset; } } @@ -596,7 +596,7 @@ class MySqlGrammar extends Grammar */ protected function modifyCollate(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->collation)) { + if (! is_null($column->collation)) { return ' collate '.$column->collation; } } @@ -622,7 +622,7 @@ class MySqlGrammar extends Grammar */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->default)) { + if (! is_null($column->default)) { return ' default '.$this->getDefaultValue($column->default); } } @@ -650,7 +650,7 @@ class MySqlGrammar extends Grammar */ protected function modifyFirst(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->first)) { + if (! is_null($column->first)) { return ' first'; } } @@ -664,7 +664,7 @@ class MySqlGrammar extends Grammar */ protected function modifyAfter(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->after)) { + if (! is_null($column->after)) { return ' after '.$this->wrap($column->after); } } @@ -678,7 +678,7 @@ class MySqlGrammar extends Grammar */ protected function modifyComment(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->comment)) { + if (! is_null($column->comment)) { return ' comment "'.$column->comment.'"'; } } diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index a6e1c6873c..d101b38f8d 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -522,7 +522,7 @@ class PostgresGrammar extends Grammar */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->default)) { + if (! is_null($column->default)) { return ' default '.$this->getDefaultValue($column->default); } } diff --git a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php index 445edb4629..5917d1e09a 100755 --- a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -84,11 +84,11 @@ class SQLiteGrammar extends Grammar foreach ($foreigns as $foreign) { $sql .= $this->getForeignKey($foreign); - if (!is_null($foreign->onDelete)) { + if (! is_null($foreign->onDelete)) { $sql .= " on delete {$foreign->onDelete}"; } - if (!is_null($foreign->onUpdate)) { + if (! is_null($foreign->onUpdate)) { $sql .= " on update {$foreign->onUpdate}"; } } @@ -126,7 +126,7 @@ class SQLiteGrammar extends Grammar { $primary = $this->getCommandByName($blueprint, 'primary'); - if (!is_null($primary)) { + if (! is_null($primary)) { $columns = $this->columnize($primary->columns); return ", primary key ({$columns})"; @@ -583,7 +583,7 @@ class SQLiteGrammar extends Grammar */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->default)) { + if (! is_null($column->default)) { return ' default '.$this->getDefaultValue($column->default); } } diff --git a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php index 8c81d66719..095e86c4e1 100755 --- a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php @@ -530,7 +530,7 @@ class SqlServerGrammar extends Grammar */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (!is_null($column->default)) { + if (! is_null($column->default)) { return ' default '.$this->getDefaultValue($column->default); } } diff --git a/src/Illuminate/Encryption/BaseEncrypter.php b/src/Illuminate/Encryption/BaseEncrypter.php index 04fe3f4cc8..1d427af138 100644 --- a/src/Illuminate/Encryption/BaseEncrypter.php +++ b/src/Illuminate/Encryption/BaseEncrypter.php @@ -41,11 +41,11 @@ abstract class BaseEncrypter // If the payload is not valid JSON or does not have the proper keys set we will // assume it is invalid and bail out of the routine since we will not be able // to decrypt the given value. We'll also check the MAC for this encryption. - if (!$payload || $this->invalidPayload($payload)) { + if (! $payload || $this->invalidPayload($payload)) { throw new DecryptException('The payload is invalid.'); } - if (!$this->validMac($payload)) { + if (! $this->validMac($payload)) { throw new DecryptException('The MAC is invalid.'); } @@ -60,7 +60,7 @@ abstract class BaseEncrypter */ protected function invalidPayload($data) { - return !is_array($data) || !isset($data['iv']) || !isset($data['value']) || !isset($data['mac']); + return ! is_array($data) || ! isset($data['iv']) || ! isset($data['value']) || ! isset($data['mac']); } /** diff --git a/src/Illuminate/Events/CallQueuedHandler.php b/src/Illuminate/Events/CallQueuedHandler.php index f8bb0cdcb8..b182cd847c 100644 --- a/src/Illuminate/Events/CallQueuedHandler.php +++ b/src/Illuminate/Events/CallQueuedHandler.php @@ -42,7 +42,7 @@ class CallQueuedHandler [$handler, $data['method']], unserialize($data['data']) ); - if (!$job->isDeletedOrReleased()) { + if (! $job->isDeletedOrReleased()) { $job->delete(); } } diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 8b880e0fcf..2273693bbe 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -207,7 +207,7 @@ class Dispatcher implements DispatcherContract // If an array is not given to us as the payload, we will turn it into one so // we can easily use call_user_func_array on the listeners, passing in the // payload to each of them so that they receive each of these arguments. - if (!is_array($payload)) { + if (! is_array($payload)) { $payload = [$payload]; } @@ -223,7 +223,7 @@ class Dispatcher implements DispatcherContract // If a response is returned from the listener and event halting is enabled // we will just return this response, and not call the rest of the event // listeners. Otherwise we will add the response on the response list. - if (!is_null($response) && $halt) { + if (! is_null($response) && $halt) { array_pop($this->firing); return $response; @@ -271,7 +271,7 @@ class Dispatcher implements DispatcherContract { $wildcards = $this->getWildcardListeners($eventName); - if (!isset($this->sorted[$eventName])) { + if (! isset($this->sorted[$eventName])) { $this->sortListeners($eventName); } diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index 05525900a8..a98902587e 100755 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -123,7 +123,7 @@ class Filesystem foreach ($paths as $path) { try { - if (!@unlink($path)) { + if (! @unlink($path)) { $success = false; } } catch (ErrorException $e) { @@ -347,7 +347,7 @@ class Filesystem */ public function copyDirectory($directory, $destination, $options = null) { - if (!$this->isDirectory($directory)) { + if (! $this->isDirectory($directory)) { return false; } @@ -356,7 +356,7 @@ class Filesystem // If the destination directory does not actually exist, we will go ahead and // create it recursively, which just gets the destination prepared to copy // the files over. Once we make the directory we'll proceed the copying. - if (!$this->isDirectory($destination)) { + if (! $this->isDirectory($destination)) { $this->makeDirectory($destination, 0777, true); } @@ -371,7 +371,7 @@ class Filesystem if ($item->isDir()) { $path = $item->getPathname(); - if (!$this->copyDirectory($path, $target, $options)) { + if (! $this->copyDirectory($path, $target, $options)) { return false; } } @@ -380,7 +380,7 @@ class Filesystem // location and keep looping. If for some reason the copy fails we'll bail out // and return false, so the developer is aware that the copy process failed. else { - if (!$this->copy($item->getPathname(), $target)) { + if (! $this->copy($item->getPathname(), $target)) { return false; } } @@ -400,7 +400,7 @@ class Filesystem */ public function deleteDirectory($directory, $preserve = false) { - if (!$this->isDirectory($directory)) { + if (! $this->isDirectory($directory)) { return false; } @@ -410,7 +410,7 @@ class Filesystem // If the item is a directory, we can just recurse into the function and // delete that sub-directory otherwise we'll just delete the file and // keep iterating through each file until the directory is cleaned. - if ($item->isDir() && !$item->isLink()) { + if ($item->isDir() && ! $item->isLink()) { $this->deleteDirectory($item->getPathname()); } @@ -422,7 +422,7 @@ class Filesystem } } - if (!$preserve) { + if (! $preserve) { @rmdir($directory); } diff --git a/src/Illuminate/Foundation/AliasLoader.php b/src/Illuminate/Foundation/AliasLoader.php index 977e8b7a11..d2a4221c5d 100755 --- a/src/Illuminate/Foundation/AliasLoader.php +++ b/src/Illuminate/Foundation/AliasLoader.php @@ -86,7 +86,7 @@ class AliasLoader */ public function register() { - if (!$this->registered) { + if (! $this->registered) { $this->prependToLoaderStack(); $this->registered = true; diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 7e58f74a97..67c44533e1 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -517,7 +517,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn */ public function register($provider, $options = [], $force = false) { - if ($registered = $this->getProvider($provider) && !$force) { + if ($registered = $this->getProvider($provider) && ! $force) { return $registered; } @@ -615,7 +615,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn */ public function loadDeferredProvider($service) { - if (!isset($this->deferredServices[$service])) { + if (! isset($this->deferredServices[$service])) { return; } @@ -624,7 +624,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn // If the service provider has not already been loaded and registered we can // register it with the application and remove the service from this list // of deferred services, since it will already be loaded on subsequent. - if (!isset($this->loadedProviders[$provider])) { + if (! isset($this->loadedProviders[$provider])) { $this->registerDeferredProvider($provider, $service); } } @@ -647,7 +647,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn $this->register($instance = new $provider($this)); - if (!$this->booted) { + if (! $this->booted) { $this->booting(function () use ($instance) { $this->bootProvider($instance); }); @@ -980,7 +980,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn */ public function hasMonologConfigurator() { - return !is_null($this->monologConfigurator); + return ! is_null($this->monologConfigurator); } /** @@ -1102,7 +1102,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn */ public function getNamespace() { - if (!is_null($this->namespace)) { + if (! is_null($this->namespace)) { return $this->namespace; } diff --git a/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php b/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php index ccc968818b..2d1bc8c2ed 100644 --- a/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php +++ b/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php @@ -5,7 +5,6 @@ namespace Illuminate\Foundation\Auth; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Lang; -use Illuminate\Support\Facades\Cache; trait AuthenticatesUsers { diff --git a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php index f93597ba93..4974e5c860 100644 --- a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php @@ -36,7 +36,7 @@ class HandleExceptions register_shutdown_function([$this, 'handleShutdown']); - if (!$app->environment('testing')) { + if (! $app->environment('testing')) { ini_set('display_errors', 'Off'); } } @@ -72,7 +72,7 @@ class HandleExceptions */ public function handleException($e) { - if (!$e instanceof Exception) { + if (! $e instanceof Exception) { $e = new FatalThrowableError($e); } @@ -114,7 +114,7 @@ class HandleExceptions */ public function handleShutdown() { - if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) { + if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) { $this->handleException($this->fatalExceptionFromError($error, 0)); } } diff --git a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php index 9ce764b60e..9f95a86d73 100644 --- a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php +++ b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php @@ -34,7 +34,7 @@ class LoadConfiguration // Next we will spin through all of the configuration files in the configuration // directory and load each one into the repository. This will make all of the // options available to the developer for use in various parts of this app. - if (!isset($loadedFromCache)) { + if (! isset($loadedFromCache)) { $this->loadConfigurationFiles($app, $config); } diff --git a/src/Illuminate/Foundation/Console/EventGenerateCommand.php b/src/Illuminate/Foundation/Console/EventGenerateCommand.php index 7f2c1bdb8b..c2db984e01 100644 --- a/src/Illuminate/Foundation/Console/EventGenerateCommand.php +++ b/src/Illuminate/Foundation/Console/EventGenerateCommand.php @@ -33,7 +33,7 @@ class EventGenerateCommand extends Command ); foreach ($provider->listens() as $event => $listeners) { - if (!Str::contains($event, '\\')) { + if (! Str::contains($event, '\\')) { continue; } diff --git a/src/Illuminate/Foundation/Console/HandlerEventCommand.php b/src/Illuminate/Foundation/Console/HandlerEventCommand.php index 9537a40faa..341ffe04e4 100644 --- a/src/Illuminate/Foundation/Console/HandlerEventCommand.php +++ b/src/Illuminate/Foundation/Console/HandlerEventCommand.php @@ -41,7 +41,7 @@ class HandlerEventCommand extends GeneratorCommand $event = $this->option('event'); - if (!Str::startsWith($event, $this->laravel->getNamespace())) { + if (! Str::startsWith($event, $this->laravel->getNamespace())) { $event = $this->laravel->getNamespace().'Events\\'.$event; } diff --git a/src/Illuminate/Foundation/Console/IlluminateCaster.php b/src/Illuminate/Foundation/Console/IlluminateCaster.php index d95a84fcad..e555c82e15 100644 --- a/src/Illuminate/Foundation/Console/IlluminateCaster.php +++ b/src/Illuminate/Foundation/Console/IlluminateCaster.php @@ -46,8 +46,8 @@ class IlluminateCaster try { $val = $app->$property(); - if (!is_null($val)) { - $results[Caster::PREFIX_VIRTUAL . $property] = $val; + if (! is_null($val)) { + $results[Caster::PREFIX_VIRTUAL.$property] = $val; } } catch (Exception $e) { // diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index f39e025b0a..2a128379ed 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -202,7 +202,7 @@ class Kernel implements KernelContract */ public function bootstrap() { - if (!$this->app->hasBeenBootstrapped()) { + if (! $this->app->hasBeenBootstrapped()) { $this->app->bootstrapWith($this->bootstrappers()); } diff --git a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php index c9f1e6940f..de624a89a9 100644 --- a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php @@ -55,7 +55,7 @@ class ListenerMakeCommand extends GeneratorCommand $event = $this->option('event'); - if (!Str::startsWith($event, $this->laravel->getNamespace())) { + if (! Str::startsWith($event, $this->laravel->getNamespace())) { $event = $this->laravel->getNamespace().'Events\\'.$event; } diff --git a/src/Illuminate/Foundation/Console/OptimizeCommand.php b/src/Illuminate/Foundation/Console/OptimizeCommand.php index 8cc19cf606..87a2ff53d7 100644 --- a/src/Illuminate/Foundation/Console/OptimizeCommand.php +++ b/src/Illuminate/Foundation/Console/OptimizeCommand.php @@ -65,7 +65,7 @@ class OptimizeCommand extends Command $this->composer->dumpOptimized(); } - if ($this->option('force') || !$this->laravel['config']['app.debug']) { + if ($this->option('force') || ! $this->laravel['config']['app.debug']) { $this->info('Compiling common classes'); $this->compileClasses(); } else { diff --git a/src/Illuminate/Foundation/Console/RouteListCommand.php b/src/Illuminate/Foundation/Console/RouteListCommand.php index b55415f1d4..a9fd5f54ff 100644 --- a/src/Illuminate/Foundation/Console/RouteListCommand.php +++ b/src/Illuminate/Foundation/Console/RouteListCommand.php @@ -147,7 +147,7 @@ class RouteListCommand extends Command $actionName = $route->getActionName(); - if (!empty($actionName) && $actionName !== 'Closure') { + if (! empty($actionName) && $actionName !== 'Closure') { $middlewares = array_merge($middlewares, $this->getControllerMiddleware($actionName)); } @@ -185,7 +185,7 @@ class RouteListCommand extends Command $results = []; foreach ($controller->getMiddleware() as $name => $options) { - if (!$this->methodExcludedByOptions($method, $options)) { + if (! $this->methodExcludedByOptions($method, $options)) { $results[] = Arr::get($middleware, $name, $name); } } @@ -202,8 +202,8 @@ class RouteListCommand extends Command */ protected function methodExcludedByOptions($method, array $options) { - return (!empty($options['only']) && !in_array($method, (array) $options['only'])) || - (!empty($options['except']) && in_array($method, (array) $options['except'])); + return (! empty($options['only']) && ! in_array($method, (array) $options['only'])) || + (! empty($options['except']) && in_array($method, (array) $options['except'])); } /** @@ -250,9 +250,9 @@ class RouteListCommand extends Command */ protected function filterRoute(array $route) { - if (($this->option('name') && !Str::contains($route['name'], $this->option('name'))) || - $this->option('path') && !Str::contains($route['uri'], $this->option('path')) || - $this->option('method') && !Str::contains($route['method'], $this->option('method'))) { + if (($this->option('name') && ! Str::contains($route['name'], $this->option('name'))) || + $this->option('path') && ! Str::contains($route['uri'], $this->option('path')) || + $this->option('method') && ! Str::contains($route['method'], $this->option('method'))) { return; } diff --git a/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/src/Illuminate/Foundation/Console/VendorPublishCommand.php index e5e5f2b915..2bb2990972 100644 --- a/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ b/src/Illuminate/Foundation/Console/VendorPublishCommand.php @@ -101,7 +101,7 @@ class VendorPublishCommand extends Command */ protected function publishFile($from, $to) { - if ($this->files->exists($to) && !$this->option('force')) { + if ($this->files->exists($to) && ! $this->option('force')) { return; } @@ -127,7 +127,7 @@ class VendorPublishCommand extends Command ]); foreach ($manager->listContents('from://', true) as $file) { - if ($file['type'] === 'file' && (!$manager->has('to://'.$file['path']) || $this->option('force'))) { + if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) { $manager->put('to://'.$file['path'], $manager->read('from://'.$file['path'])); } } @@ -143,7 +143,7 @@ class VendorPublishCommand extends Command */ protected function createParentDirectory($directory) { - if (!$this->files->isDirectory($directory)) { + if (! $this->files->isDirectory($directory)) { $this->files->makeDirectory($directory, 0755, true); } } diff --git a/src/Illuminate/Foundation/EnvironmentDetector.php b/src/Illuminate/Foundation/EnvironmentDetector.php index 35e16395d8..9acdca80e0 100644 --- a/src/Illuminate/Foundation/EnvironmentDetector.php +++ b/src/Illuminate/Foundation/EnvironmentDetector.php @@ -47,7 +47,7 @@ class EnvironmentDetector // First we will check if an environment argument was passed via console arguments // and if it was that automatically overrides as the environment. Otherwise, we // will check the environment as a "web" request like a typical HTTP request. - if (!is_null($value = $this->getEnvironmentArgument($args))) { + if (! is_null($value = $this->getEnvironmentArgument($args))) { return head(array_slice(explode('=', $value), 1)); } diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php index be197534d2..01c361a623 100644 --- a/src/Illuminate/Foundation/Exceptions/Handler.php +++ b/src/Illuminate/Foundation/Exceptions/Handler.php @@ -58,7 +58,7 @@ class Handler implements ExceptionHandlerContract */ public function shouldReport(Exception $e) { - return !$this->shouldntReport($e); + return ! $this->shouldntReport($e); } /** diff --git a/src/Illuminate/Foundation/Http/Kernel.php b/src/Illuminate/Foundation/Http/Kernel.php index 6eeb68ded3..6300da3815 100644 --- a/src/Illuminate/Foundation/Http/Kernel.php +++ b/src/Illuminate/Foundation/Http/Kernel.php @@ -4,7 +4,6 @@ namespace Illuminate\Foundation\Http; use Exception; use Throwable; -use RuntimeException; use Illuminate\Routing\Router; use Illuminate\Pipeline\Pipeline; use Illuminate\Support\Facades\Facade; @@ -219,7 +218,7 @@ class Kernel implements KernelContract */ public function bootstrap() { - if (!$this->app->hasBeenBootstrapped()) { + if (! $this->app->hasBeenBootstrapped()) { $this->app->bootstrapWith($this->bootstrappers()); } } diff --git a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php index cf4e5746c2..4f1045af51 100644 --- a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php +++ b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php @@ -80,7 +80,7 @@ class VerifyCsrfToken { $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN'); - if (!$token && $header = $request->header('X-XSRF-TOKEN')) { + if (! $token && $header = $request->header('X-XSRF-TOKEN')) { $token = $this->encrypter->decrypt($header); } diff --git a/src/Illuminate/Foundation/Testing/ApplicationTrait.php b/src/Illuminate/Foundation/Testing/ApplicationTrait.php index cd79d31b1c..0abe52df6a 100644 --- a/src/Illuminate/Foundation/Testing/ApplicationTrait.php +++ b/src/Illuminate/Foundation/Testing/ApplicationTrait.php @@ -162,7 +162,7 @@ trait ApplicationTrait */ protected function startSession() { - if (!$this->app['session']->isStarted()) { + if (! $this->app['session']->isStarted()) { $this->app['session']->start(); } } diff --git a/src/Illuminate/Foundation/Testing/AssertionsTrait.php b/src/Illuminate/Foundation/Testing/AssertionsTrait.php index 4d9df8f727..4cde5ea23c 100644 --- a/src/Illuminate/Foundation/Testing/AssertionsTrait.php +++ b/src/Illuminate/Foundation/Testing/AssertionsTrait.php @@ -45,7 +45,7 @@ trait AssertionsTrait return $this->assertViewHasAll($key); } - if (!isset($this->response->original) || !$this->response->original instanceof View) { + if (! isset($this->response->original) || ! $this->response->original instanceof View) { return PHPUnit::assertTrue(false, 'The response was not a view.'); } @@ -81,7 +81,7 @@ trait AssertionsTrait */ public function assertViewMissing($key) { - if (!isset($this->response->original) || !$this->response->original instanceof View) { + if (! isset($this->response->original) || ! $this->response->original instanceof View) { return PHPUnit::assertTrue(false, 'The response was not a view.'); } diff --git a/src/Illuminate/Foundation/Testing/CrawlerTrait.php b/src/Illuminate/Foundation/Testing/CrawlerTrait.php index 9c8a9a6861..25987dd49b 100644 --- a/src/Illuminate/Foundation/Testing/CrawlerTrait.php +++ b/src/Illuminate/Foundation/Testing/CrawlerTrait.php @@ -296,7 +296,7 @@ trait CrawlerTrait { $this->seeJson(); - if (!is_null($data)) { + if (! is_null($data)) { return $this->seeJson($data); } } @@ -448,7 +448,7 @@ trait CrawlerTrait $this->assertTrue($headers->has($headerName), "Header [{$headerName}] not present on response."); - if (!is_null($value)) { + if (! is_null($value)) { $this->assertEquals( $headers->get($headerName), $value, "Header [{$headerName}] was found, but value [{$headers->get($headerName)}] does not match [{$value}]." @@ -480,7 +480,7 @@ trait CrawlerTrait $this->assertTrue($exist, "Cookie [{$cookieName}] not present on response."); - if (!is_null($value)) { + if (! is_null($value)) { $this->assertEquals( $cookie->getValue(), $value, "Cookie [{$cookieName}] was found, but value [{$cookie->getValue()}] does not match [{$value}]." @@ -500,10 +500,10 @@ trait CrawlerTrait { $link = $this->crawler->selectLink($name); - if (!count($link)) { + if (! count($link)) { $link = $this->filterByNameOrId($name, 'a'); - if (!count($link)) { + if (! count($link)) { throw new InvalidArgumentException( "Could not find a link with a body, name, or ID attribute of [{$name}]." ); @@ -599,7 +599,7 @@ trait CrawlerTrait */ protected function fillForm($buttonText, $inputs = []) { - if (!is_string($buttonText)) { + if (! is_string($buttonText)) { $inputs = $buttonText; $buttonText = null; @@ -657,7 +657,7 @@ trait CrawlerTrait { $crawler = $this->filterByNameOrId($filter); - if (!count($crawler)) { + if (! count($crawler)) { throw new InvalidArgumentException( "Nothing matched the filter [{$filter}] CSS query provided for [{$this->currentUri}]." ); @@ -779,7 +779,7 @@ trait CrawlerTrait $uri = substr($uri, 1); } - if (!Str::startsWith($uri, 'http')) { + if (! Str::startsWith($uri, 'http')) { $uri = $this->baseUrl.'/'.$uri; } @@ -801,7 +801,7 @@ trait CrawlerTrait $name = strtr(strtoupper($name), '-', '_'); if (! starts_with($name, $prefix) && $name != 'CONTENT_TYPE') { - $name = $prefix . $name; + $name = $prefix.$name; } $server[$name] = $value; diff --git a/src/Illuminate/Foundation/Testing/TestCase.php b/src/Illuminate/Foundation/Testing/TestCase.php index 54383e35de..cd015b2259 100755 --- a/src/Illuminate/Foundation/Testing/TestCase.php +++ b/src/Illuminate/Foundation/Testing/TestCase.php @@ -32,7 +32,7 @@ abstract class TestCase extends PHPUnit_Framework_TestCase */ public function setUp() { - if (!$this->app) { + if (! $this->app) { $this->refreshApplication(); } } diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 58bcc08c5f..09f6a35652 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -3,7 +3,7 @@ use Illuminate\Support\Str; use Illuminate\Container\Container; -if (!function_exists('abort')) { +if (! function_exists('abort')) { /** * Throw an HttpException with the given data. * @@ -21,7 +21,7 @@ if (!function_exists('abort')) { } } -if (!function_exists('action')) { +if (! function_exists('action')) { /** * Generate a URL to a controller action. * @@ -36,7 +36,7 @@ if (!function_exists('action')) { } } -if (!function_exists('app')) { +if (! function_exists('app')) { /** * Get the available container instance. * @@ -54,7 +54,7 @@ if (!function_exists('app')) { } } -if (!function_exists('app_path')) { +if (! function_exists('app_path')) { /** * Get the path to the application folder. * @@ -67,7 +67,7 @@ if (!function_exists('app_path')) { } } -if (!function_exists('asset')) { +if (! function_exists('asset')) { /** * Generate an asset path for the application. * @@ -81,7 +81,7 @@ if (!function_exists('asset')) { } } -if (!function_exists('auth')) { +if (! function_exists('auth')) { /** * Get the available auth instance. * @@ -93,7 +93,7 @@ if (!function_exists('auth')) { } } -if (!function_exists('base_path')) { +if (! function_exists('base_path')) { /** * Get the path to the base of the install. * @@ -106,7 +106,7 @@ if (!function_exists('base_path')) { } } -if (!function_exists('back')) { +if (! function_exists('back')) { /** * Create a new redirect response to the previous location. * @@ -120,7 +120,7 @@ if (!function_exists('back')) { } } -if (!function_exists('bcrypt')) { +if (! function_exists('bcrypt')) { /** * Hash the given value. * @@ -134,7 +134,7 @@ if (!function_exists('bcrypt')) { } } -if (!function_exists('config')) { +if (! function_exists('config')) { /** * Get / set the specified configuration value. * @@ -158,7 +158,7 @@ if (!function_exists('config')) { } } -if (!function_exists('config_path')) { +if (! function_exists('config_path')) { /** * Get the configuration path. * @@ -171,7 +171,7 @@ if (!function_exists('config_path')) { } } -if (!function_exists('cookie')) { +if (! function_exists('cookie')) { /** * Create a new cookie instance. * @@ -196,7 +196,7 @@ if (!function_exists('cookie')) { } } -if (!function_exists('csrf_field')) { +if (! function_exists('csrf_field')) { /** * Generate a CSRF token form field. * @@ -208,7 +208,7 @@ if (!function_exists('csrf_field')) { } } -if (!function_exists('csrf_token')) { +if (! function_exists('csrf_token')) { /** * Get the CSRF token value. * @@ -228,7 +228,7 @@ if (!function_exists('csrf_token')) { } } -if (!function_exists('database_path')) { +if (! function_exists('database_path')) { /** * Get the database path. * @@ -241,7 +241,7 @@ if (!function_exists('database_path')) { } } -if (!function_exists('delete')) { +if (! function_exists('delete')) { /** * Register a new DELETE route with the router. * @@ -255,7 +255,7 @@ if (!function_exists('delete')) { } } -if (!function_exists('factory')) { +if (! function_exists('factory')) { /** * Create a model factory builder for a given class, name, and amount. * @@ -278,7 +278,7 @@ if (!function_exists('factory')) { } } -if (!function_exists('get')) { +if (! function_exists('get')) { /** * Register a new GET route with the router. * @@ -292,7 +292,7 @@ if (!function_exists('get')) { } } -if (!function_exists('info')) { +if (! function_exists('info')) { /** * Write some information to the log. * @@ -306,7 +306,7 @@ if (!function_exists('info')) { } } -if (!function_exists('logger')) { +if (! function_exists('logger')) { /** * Log a debug message to the logs. * @@ -324,7 +324,7 @@ if (!function_exists('logger')) { } } -if (!function_exists('method_field')) { +if (! function_exists('method_field')) { /** * Generate a form field to spoof the HTTP verb used by forms. * @@ -337,7 +337,7 @@ if (!function_exists('method_field')) { } } -if (!function_exists('old')) { +if (! function_exists('old')) { /** * Retrieve an old input item. * @@ -351,7 +351,7 @@ if (!function_exists('old')) { } } -if (!function_exists('patch')) { +if (! function_exists('patch')) { /** * Register a new PATCH route with the router. * @@ -365,7 +365,7 @@ if (!function_exists('patch')) { } } -if (!function_exists('post')) { +if (! function_exists('post')) { /** * Register a new POST route with the router. * @@ -379,7 +379,7 @@ if (!function_exists('post')) { } } -if (!function_exists('put')) { +if (! function_exists('put')) { /** * Register a new PUT route with the router. * @@ -393,7 +393,7 @@ if (!function_exists('put')) { } } -if (!function_exists('public_path')) { +if (! function_exists('public_path')) { /** * Get the path to the public folder. * @@ -406,7 +406,7 @@ if (!function_exists('public_path')) { } } -if (!function_exists('redirect')) { +if (! function_exists('redirect')) { /** * Get an instance of the redirector. * @@ -426,7 +426,7 @@ if (!function_exists('redirect')) { } } -if (!function_exists('resource')) { +if (! function_exists('resource')) { /** * Route a resource to a controller. * @@ -441,7 +441,7 @@ if (!function_exists('resource')) { } } -if (!function_exists('response')) { +if (! function_exists('response')) { /** * Return a new response from the application. * @@ -462,7 +462,7 @@ if (!function_exists('response')) { } } -if (!function_exists('route')) { +if (! function_exists('route')) { /** * Generate a URL to a named route. * @@ -478,7 +478,7 @@ if (!function_exists('route')) { } } -if (!function_exists('secure_asset')) { +if (! function_exists('secure_asset')) { /** * Generate an asset path for the application. * @@ -491,7 +491,7 @@ if (!function_exists('secure_asset')) { } } -if (!function_exists('secure_url')) { +if (! function_exists('secure_url')) { /** * Generate a HTTPS url for the application. * @@ -505,7 +505,7 @@ if (!function_exists('secure_url')) { } } -if (!function_exists('session')) { +if (! function_exists('session')) { /** * Get / set the specified session value. * @@ -529,7 +529,7 @@ if (!function_exists('session')) { } } -if (!function_exists('storage_path')) { +if (! function_exists('storage_path')) { /** * Get the path to the storage folder. * @@ -542,7 +542,7 @@ if (!function_exists('storage_path')) { } } -if (!function_exists('trans')) { +if (! function_exists('trans')) { /** * Translate the given message. * @@ -562,7 +562,7 @@ if (!function_exists('trans')) { } } -if (!function_exists('trans_choice')) { +if (! function_exists('trans_choice')) { /** * Translates the given message based on a count. * @@ -579,7 +579,7 @@ if (!function_exists('trans_choice')) { } } -if (!function_exists('url')) { +if (! function_exists('url')) { /** * Generate a url for the application. * @@ -594,7 +594,7 @@ if (!function_exists('url')) { } } -if (!function_exists('view')) { +if (! function_exists('view')) { /** * Get the evaluated view contents for the given view. * @@ -615,7 +615,7 @@ if (!function_exists('view')) { } } -if (!function_exists('env')) { +if (! function_exists('env')) { /** * Gets the value of an environment variable. Supports boolean, empty and null. * @@ -657,7 +657,7 @@ if (!function_exists('env')) { } } -if (!function_exists('event')) { +if (! function_exists('event')) { /** * Fire an event and call the listeners. * @@ -672,7 +672,7 @@ if (!function_exists('event')) { } } -if (!function_exists('elixir')) { +if (! function_exists('elixir')) { /** * Get the path to a versioned Elixir file. * diff --git a/src/Illuminate/Http/RedirectResponse.php b/src/Illuminate/Http/RedirectResponse.php index d589a0f1d7..7911c8e2ab 100755 --- a/src/Illuminate/Http/RedirectResponse.php +++ b/src/Illuminate/Http/RedirectResponse.php @@ -77,7 +77,7 @@ class RedirectResponse extends BaseRedirectResponse $value = array_filter($value, $callback); } - return !$value instanceof UploadedFile; + return ! $value instanceof UploadedFile; })); return $this; diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index 17ba49a9a2..fcc2a2e210 100755 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -224,7 +224,7 @@ class Request extends SymfonyRequest implements ArrayAccess $input = $this->all(); foreach ($keys as $value) { - if (!array_key_exists($value, $input)) { + if (! array_key_exists($value, $input)) { return false; } } @@ -263,7 +263,7 @@ class Request extends SymfonyRequest implements ArrayAccess $boolOrArray = is_bool($value) || is_array($value); - return !$boolOrArray && trim((string) $value) === ''; + return ! $boolOrArray && trim((string) $value) === ''; } /** @@ -348,7 +348,7 @@ class Request extends SymfonyRequest implements ArrayAccess */ public function hasCookie($key) { - return !is_null($this->cookie($key)); + return ! is_null($this->cookie($key)); } /** @@ -383,7 +383,7 @@ class Request extends SymfonyRequest implements ArrayAccess */ public function hasFile($key) { - if (!is_array($files = $this->file($key))) { + if (! is_array($files = $this->file($key))) { $files = [$files]; } @@ -452,7 +452,7 @@ class Request extends SymfonyRequest implements ArrayAccess */ public function flash($filter = null, $keys = []) { - $flash = (!is_null($filter)) ? $this->$filter($keys) : $this->input(); + $flash = (! is_null($filter)) ? $this->$filter($keys) : $this->input(); $this->session()->flashInput($flash); } @@ -541,7 +541,7 @@ class Request extends SymfonyRequest implements ArrayAccess */ public function json($key = null, $default = null) { - if (!isset($this->json)) { + if (! isset($this->json)) { $this->json = new ParameterBag((array) json_decode($this->getContent(), true)); } @@ -659,7 +659,7 @@ class Request extends SymfonyRequest implements ArrayAccess foreach ($contentTypes as $contentType) { $type = $contentType; - if (!is_null($mimeType = $this->getMimeType($contentType))) { + if (! is_null($mimeType = $this->getMimeType($contentType))) { $type = $mimeType; } @@ -752,7 +752,7 @@ class Request extends SymfonyRequest implements ArrayAccess */ public function session() { - if (!$this->hasSession()) { + if (! $this->hasSession()) { throw new RuntimeException('Session store not set on request.'); } diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index adf5ca28b2..712b6450aa 100755 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -271,7 +271,7 @@ class Writer implements LogContract, PsrLoggerInterface */ public function listen(Closure $callback) { - if (!isset($this->dispatcher)) { + if (! isset($this->dispatcher)) { throw new RuntimeException('Events dispatcher has not been set.'); } diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index 3177327474..9a25b2036e 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -258,7 +258,7 @@ class Mailer implements MailerContract, MailQueueContract */ protected function buildQueueCallable($callback) { - if (!$callback instanceof Closure) { + if (! $callback instanceof Closure) { return $callback; } @@ -378,7 +378,7 @@ class Mailer implements MailerContract, MailQueueContract $this->events->fire('mailer.sending', [$message]); } - if (!$this->pretending) { + if (! $this->pretending) { return $this->swift->send($message, $this->failedRecipients); } elseif (isset($this->logger)) { $this->logMessage($message); @@ -432,7 +432,7 @@ class Mailer implements MailerContract, MailQueueContract // If a global from address has been specified we will set it on every message // instances so the developer does not have to repeat themselves every time // they create a new message. We will just go ahead and push the address. - if (!empty($this->from['address'])) { + if (! empty($this->from['address'])) { $message->from($this->from['address'], $this->from['name']); } diff --git a/src/Illuminate/Pagination/AbstractPaginator.php b/src/Illuminate/Pagination/AbstractPaginator.php index 4df4ba49a4..cea040833d 100644 --- a/src/Illuminate/Pagination/AbstractPaginator.php +++ b/src/Illuminate/Pagination/AbstractPaginator.php @@ -275,7 +275,7 @@ abstract class AbstractPaginator */ public function hasPages() { - return !($this->currentPage() == 1 && !$this->hasMorePages()); + return ! ($this->currentPage() == 1 && ! $this->hasMorePages()); } /** diff --git a/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php b/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php index 49fdbf903f..a8fda50519 100644 --- a/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php +++ b/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php @@ -37,7 +37,7 @@ trait BootstrapThreeNextPreviousButtonRendererTrait // If the current page is greater than or equal to the last page, it means we // can't go any further into the pages, as we're already on this last page // that is available, so we will make it the "next" link style disabled. - if (!$this->paginator->hasMorePages()) { + if (! $this->paginator->hasMorePages()) { return $this->getDisabledTextWrapper($text); } diff --git a/src/Illuminate/Pagination/UrlWindow.php b/src/Illuminate/Pagination/UrlWindow.php index 62248707e6..655f646dc7 100644 --- a/src/Illuminate/Pagination/UrlWindow.php +++ b/src/Illuminate/Pagination/UrlWindow.php @@ -75,7 +75,7 @@ class UrlWindow { $window = $onEachSide * 2; - if (!$this->hasPages()) { + if (! $this->hasPages()) { return [ 'first' => null, 'slider' => null, diff --git a/src/Illuminate/Queue/CallQueuedHandler.php b/src/Illuminate/Queue/CallQueuedHandler.php index 86dc73854b..dc16c88b9f 100644 --- a/src/Illuminate/Queue/CallQueuedHandler.php +++ b/src/Illuminate/Queue/CallQueuedHandler.php @@ -42,7 +42,7 @@ class CallQueuedHandler $this->setJobInstanceIfNecessary($job, $handler); }); - if (!$job->isDeletedOrReleased()) { + if (! $job->isDeletedOrReleased()) { $job->delete(); } } diff --git a/src/Illuminate/Queue/Console/RetryCommand.php b/src/Illuminate/Queue/Console/RetryCommand.php index 64f1e43df4..f8a373c8be 100644 --- a/src/Illuminate/Queue/Console/RetryCommand.php +++ b/src/Illuminate/Queue/Console/RetryCommand.php @@ -30,7 +30,7 @@ class RetryCommand extends Command { $failed = $this->laravel['queue.failer']->find($this->argument('id')); - if (!is_null($failed)) { + if (! is_null($failed)) { $failed = (object) $failed; $failed->payload = $this->resetAttempts($failed->payload); diff --git a/src/Illuminate/Queue/Console/SubscribeCommand.php b/src/Illuminate/Queue/Console/SubscribeCommand.php index 2ac9bfbb84..48d4501744 100755 --- a/src/Illuminate/Queue/Console/SubscribeCommand.php +++ b/src/Illuminate/Queue/Console/SubscribeCommand.php @@ -47,7 +47,7 @@ class SubscribeCommand extends Command { $iron = $this->laravel['queue']->connection(); - if (!$iron instanceof IronQueue) { + if (! $iron instanceof IronQueue) { throw new RuntimeException('Iron.io based queue must be default.'); } @@ -97,7 +97,7 @@ class SubscribeCommand extends Command $url = $this->argument('url'); - if (!Str::startsWith($url, ['http://', 'https://'])) { + if (! Str::startsWith($url, ['http://', 'https://'])) { $url = $this->laravel['url']->to($url); } diff --git a/src/Illuminate/Queue/Console/WorkCommand.php b/src/Illuminate/Queue/Console/WorkCommand.php index de52e1934a..1ae918f6a3 100755 --- a/src/Illuminate/Queue/Console/WorkCommand.php +++ b/src/Illuminate/Queue/Console/WorkCommand.php @@ -51,7 +51,7 @@ class WorkCommand extends Command */ public function fire() { - if ($this->downForMaintenance() && !$this->option('daemon')) { + if ($this->downForMaintenance() && ! $this->option('daemon')) { return $this->worker->sleep($this->option('sleep')); } @@ -73,7 +73,7 @@ class WorkCommand extends Command // If a job was fired by the worker, we'll write the output out to the console // so that the developer can watch live while the queue runs in the console // window, which will also of get logged if stdout is logged out to disk. - if (!is_null($response['job'])) { + if (! is_null($response['job'])) { $this->writeOutput($response['job'], $response['failed']); } } diff --git a/src/Illuminate/Queue/DatabaseQueue.php b/src/Illuminate/Queue/DatabaseQueue.php index 68388bb00e..fb889e2bcd 100644 --- a/src/Illuminate/Queue/DatabaseQueue.php +++ b/src/Illuminate/Queue/DatabaseQueue.php @@ -160,7 +160,7 @@ class DatabaseQueue extends Queue implements QueueContract { $queue = $this->getQueue($queue); - if (!is_null($this->expire)) { + if (! is_null($this->expire)) { $this->releaseJobsThatHaveBeenReservedTooLong($queue); } diff --git a/src/Illuminate/Queue/IronQueue.php b/src/Illuminate/Queue/IronQueue.php index 2ff286ba3e..5132898078 100755 --- a/src/Illuminate/Queue/IronQueue.php +++ b/src/Illuminate/Queue/IronQueue.php @@ -133,7 +133,7 @@ class IronQueue extends Queue implements QueueContract // If we were able to pop a message off of the queue, we will need to decrypt // the message body, as all Iron.io messages are encrypted, since the push // queues will be a security hazard to unsuspecting developers using it. - if (!is_null($job)) { + if (! is_null($job)) { $job->body = $this->parseJobBody($job->body); return new IronJob($this->container, $this, $job); diff --git a/src/Illuminate/Queue/Jobs/IronJob.php b/src/Illuminate/Queue/Jobs/IronJob.php index 66e6673a6b..6793bcd74f 100755 --- a/src/Illuminate/Queue/Jobs/IronJob.php +++ b/src/Illuminate/Queue/Jobs/IronJob.php @@ -96,7 +96,7 @@ class IronJob extends Job implements JobContract { parent::release($delay); - if (!$this->pushed) { + if (! $this->pushed) { $this->delete(); } diff --git a/src/Illuminate/Queue/QueueManager.php b/src/Illuminate/Queue/QueueManager.php index 8dc5759a33..f8d84e0551 100755 --- a/src/Illuminate/Queue/QueueManager.php +++ b/src/Illuminate/Queue/QueueManager.php @@ -98,7 +98,7 @@ class QueueManager implements FactoryContract, MonitorContract // If the connection has not been resolved yet we will resolve it now as all // of the connections are resolved when they are actually needed so we do // not make any unnecessary connection to the various queue end-points. - if (!isset($this->connections[$name])) { + if (! isset($this->connections[$name])) { $this->connections[$name] = $this->resolve($name); $this->connections[$name]->setContainer($this->app); diff --git a/src/Illuminate/Queue/RedisQueue.php b/src/Illuminate/Queue/RedisQueue.php index 2b56cacc51..2e91e9a838 100644 --- a/src/Illuminate/Queue/RedisQueue.php +++ b/src/Illuminate/Queue/RedisQueue.php @@ -129,13 +129,13 @@ class RedisQueue extends Queue implements QueueContract $queue = $this->getQueue($queue); - if (!is_null($this->expire)) { + if (! is_null($this->expire)) { $this->migrateAllExpiredJobs($queue); } $job = $this->getConnection()->lpop($queue); - if (!is_null($job)) { + if (! is_null($job)) { $this->getConnection()->zadd($queue.':reserved', $this->getTime() + $this->expire, $job); return new RedisJob($this->container, $this, $job, $original); diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index 7bfb4b42cd..fca2953f48 100755 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -153,7 +153,7 @@ class Worker // If we're able to pull a job off of the stack, we will process it and // then immediately return back out. If there is no job on the queue // we will "sleep" the worker for the specified number of seconds. - if (!is_null($job)) { + if (! is_null($job)) { return $this->process( $this->manager->getName($connectionName), $job, $maxTries, $delay ); @@ -178,7 +178,7 @@ class Worker } foreach (explode(',', $queue) as $queue) { - if (!is_null($job = $connection->pop($queue))) { + if (! is_null($job = $connection->pop($queue))) { return $job; } } @@ -212,13 +212,13 @@ class Worker // If we catch an exception, we will attempt to release the job back onto // the queue so it is not lost. This will let is be retried at a later // time by another listener (or the same one). We will do that here. - if (!$job->isDeleted()) { + if (! $job->isDeleted()) { $job->release($delay); } throw $e; } catch (Throwable $e) { - if (!$job->isDeleted()) { + if (! $job->isDeleted()) { $job->release($delay); } diff --git a/src/Illuminate/Routing/ControllerDispatcher.php b/src/Illuminate/Routing/ControllerDispatcher.php index 2e5bc59822..2967c7f75f 100644 --- a/src/Illuminate/Routing/ControllerDispatcher.php +++ b/src/Illuminate/Routing/ControllerDispatcher.php @@ -126,7 +126,7 @@ class ControllerDispatcher $results = []; foreach ($instance->getMiddleware() as $name => $options) { - if (!$this->methodExcludedByOptions($method, $options)) { + if (! $this->methodExcludedByOptions($method, $options)) { $results[] = $this->router->resolveMiddlewareClassName($name); } } @@ -143,8 +143,8 @@ class ControllerDispatcher */ public function methodExcludedByOptions($method, array $options) { - return (!empty($options['only']) && !in_array($method, (array) $options['only'])) || - (!empty($options['except']) && in_array($method, (array) $options['except'])); + return (! empty($options['only']) && ! in_array($method, (array) $options['only'])) || + (! empty($options['except']) && in_array($method, (array) $options['except'])); } /** @@ -182,7 +182,7 @@ class ControllerDispatcher // them until we get a response or are finished iterating through this filters. $response = $this->callFilter($filter, $route, $request); - if (!is_null($response)) { + if (! is_null($response)) { return $response; } } @@ -280,7 +280,7 @@ class ControllerDispatcher $on = explode('|', $on); } - return !in_array(strtolower($request->getMethod()), $on); + return ! in_array(strtolower($request->getMethod()), $on); } /** diff --git a/src/Illuminate/Routing/Matching/SchemeValidator.php b/src/Illuminate/Routing/Matching/SchemeValidator.php index 700571bfeb..fd5d5af8fa 100644 --- a/src/Illuminate/Routing/Matching/SchemeValidator.php +++ b/src/Illuminate/Routing/Matching/SchemeValidator.php @@ -17,7 +17,7 @@ class SchemeValidator implements ValidatorInterface public function matches(Route $route, Request $request) { if ($route->httpOnly()) { - return !$request->secure(); + return ! $request->secure(); } elseif ($route->secure()) { return $request->secure(); } diff --git a/src/Illuminate/Routing/ResourceRegistrar.php b/src/Illuminate/Routing/ResourceRegistrar.php index 19749189a0..60472845f2 100644 --- a/src/Illuminate/Routing/ResourceRegistrar.php +++ b/src/Illuminate/Routing/ResourceRegistrar.php @@ -128,7 +128,7 @@ class ResourceRegistrar */ public function getResourceUri($resource) { - if (!Str::contains($resource, '.')) { + if (! Str::contains($resource, '.')) { return $resource; } @@ -194,7 +194,7 @@ class ResourceRegistrar // the resource action. Otherwise we'll just use an empty string for here. $prefix = isset($options['as']) ? $options['as'].'.' : ''; - if (!$this->router->hasGroupStack()) { + if (! $this->router->hasGroupStack()) { return $prefix.$resource.'.'.$method; } diff --git a/src/Illuminate/Routing/ResponseFactory.php b/src/Illuminate/Routing/ResponseFactory.php index ae6617096e..02e77cb34f 100644 --- a/src/Illuminate/Routing/ResponseFactory.php +++ b/src/Illuminate/Routing/ResponseFactory.php @@ -82,7 +82,7 @@ class ResponseFactory implements FactoryContract */ public function json($data = [], $status = 200, array $headers = [], $options = 0) { - if ($data instanceof Arrayable && !$data instanceof JsonSerializable) { + if ($data instanceof Arrayable && ! $data instanceof JsonSerializable) { $data = $data->toArray(); } @@ -130,7 +130,7 @@ class ResponseFactory implements FactoryContract { $response = new BinaryFileResponse($file, 200, $headers, true, $disposition); - if (!is_null($name)) { + if (! is_null($name)) { return $response->setContentDisposition($disposition, $name, str_replace('%', '', Str::ascii($name))); } diff --git a/src/Illuminate/Routing/Route.php b/src/Illuminate/Routing/Route.php index 6ded4e3a29..72f1c72f29 100755 --- a/src/Illuminate/Routing/Route.php +++ b/src/Illuminate/Routing/Route.php @@ -106,7 +106,7 @@ class Route $this->methods = (array) $methods; $this->action = $this->parseAction($action); - if (in_array('GET', $this->methods) && !in_array('HEAD', $this->methods)) { + if (in_array('GET', $this->methods) && ! in_array('HEAD', $this->methods)) { $this->methods[] = 'HEAD'; } @@ -126,7 +126,7 @@ class Route $this->container = $this->container ?: new Container; try { - if (!is_string($this->action['uses'])) { + if (! is_string($this->action['uses'])) { return $this->runCallable($request); } @@ -169,7 +169,7 @@ class Route $this->parametersWithoutNulls(), $class, $method ); - if (!method_exists($instance = $this->container->make($class), $method)) { + if (! method_exists($instance = $this->container->make($class), $method)) { throw new NotFoundHttpException; } @@ -213,11 +213,11 @@ class Route $this->compileRoute(); foreach ($this->getValidators() as $validator) { - if (!$includingMethod && $validator instanceof MethodValidator) { + if (! $includingMethod && $validator instanceof MethodValidator) { continue; } - if (!$validator->matches($this, $request)) { + if (! $validator->matches($this, $request)) { return false; } } @@ -274,7 +274,7 @@ class Route */ public function beforeFilters() { - if (!isset($this->action['before'])) { + if (! isset($this->action['before'])) { return []; } @@ -290,7 +290,7 @@ class Route */ public function afterFilters() { - if (!isset($this->action['after'])) { + if (! isset($this->action['after'])) { return []; } @@ -354,7 +354,7 @@ class Route */ public static function parseFilter($filter) { - if (!Str::contains($filter, ':')) { + if (! Str::contains($filter, ':')) { return [$filter, []]; } @@ -462,7 +462,7 @@ class Route */ public function parametersWithoutNulls() { - return array_filter($this->parameters(), function ($p) { return !is_null($p); }); + return array_filter($this->parameters(), function ($p) { return ! is_null($p); }); } /** @@ -526,7 +526,7 @@ class Route // If the route has a regular expression for the host part of the URI, we will // compile that and get the parameter matches for this domain. We will then // merge them into this parameters array so that this array is completed. - if (!is_null($this->compiled->getHostRegex())) { + if (! is_null($this->compiled->getHostRegex())) { $params = $this->bindHostParameters( $request, $params ); @@ -616,7 +616,7 @@ class Route // If no "uses" property has been set, we will dig through the array to find a // Closure instance within this list. We will set the first Closure we come // across into the "uses" property that will get fired off by this route. - elseif (!isset($action['uses'])) { + elseif (! isset($action['uses'])) { $action['uses'] = $this->findCallable($action); } diff --git a/src/Illuminate/Routing/RouteCollection.php b/src/Illuminate/Routing/RouteCollection.php index eb7b7d25f1..6b2f782acd 100644 --- a/src/Illuminate/Routing/RouteCollection.php +++ b/src/Illuminate/Routing/RouteCollection.php @@ -127,7 +127,7 @@ class RouteCollection implements Countable, IteratorAggregate // by the consumer. Otherwise we will check for routes with another verb. $route = $this->check($routes, $request); - if (!is_null($route)) { + if (! is_null($route)) { return $route->bind($request); } @@ -159,7 +159,7 @@ class RouteCollection implements Countable, IteratorAggregate $others = []; foreach ($methods as $method) { - if (!is_null($this->check($this->get($method), $request, false))) { + if (! is_null($this->check($this->get($method), $request, false))) { $others[] = $method; } } @@ -239,7 +239,7 @@ class RouteCollection implements Countable, IteratorAggregate */ public function hasNamedRoute($name) { - return !is_null($this->getByName($name)); + return ! is_null($this->getByName($name)); } /** diff --git a/src/Illuminate/Routing/RouteDependencyResolverTrait.php b/src/Illuminate/Routing/RouteDependencyResolverTrait.php index 07a7fae2db..2656d5f0d1 100644 --- a/src/Illuminate/Routing/RouteDependencyResolverTrait.php +++ b/src/Illuminate/Routing/RouteDependencyResolverTrait.php @@ -32,7 +32,7 @@ trait RouteDependencyResolverTrait */ protected function resolveClassMethodDependencies(array $parameters, $instance, $method) { - if (!method_exists($instance, $method)) { + if (! method_exists($instance, $method)) { return $parameters; } @@ -56,7 +56,7 @@ trait RouteDependencyResolverTrait // binding and we do not want to mess with those; otherwise, we resolve it here. $class = $parameter->getClass(); - if ($class && !$this->alreadyInParameters($class->name, $parameters)) { + if ($class && ! $this->alreadyInParameters($class->name, $parameters)) { array_splice( $parameters, $key, 0, [$this->container->make($class->name)] ); @@ -75,7 +75,7 @@ trait RouteDependencyResolverTrait */ protected function alreadyInParameters($class, array $parameters) { - return !is_null(Arr::first($parameters, function ($key, $value) use ($class) { + return ! is_null(Arr::first($parameters, function ($key, $value) use ($class) { return $value instanceof $class; })); } diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 85bcbc2ab3..25d3e8504c 100755 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -247,7 +247,7 @@ class Router implements RegistrarContract // First, we will check to see if a controller prefix has been registered in // the route group. If it has, we will need to prefix it before trying to // reflect into the class instance and pull out the method for routing. - if (!empty($this->groupStack)) { + if (! empty($this->groupStack)) { $prepended = $this->prependGroupUses($controller); } @@ -360,7 +360,7 @@ class Router implements RegistrarContract */ protected function updateGroupStack(array $attributes) { - if (!empty($this->groupStack)) { + if (! empty($this->groupStack)) { $attributes = $this->mergeGroup($attributes, end($this->groupStack)); } @@ -450,7 +450,7 @@ class Router implements RegistrarContract */ public function getLastGroupPrefix() { - if (!empty($this->groupStack)) { + if (! empty($this->groupStack)) { $last = end($this->groupStack); return isset($last['prefix']) ? $last['prefix'] : ''; @@ -587,7 +587,7 @@ class Router implements RegistrarContract // Here we'll merge any group "uses" statement if necessary so that the action // has the proper clause for this property. Then we can simply set the name // of the controller on the action and return the action array for usage. - if (!empty($this->groupStack)) { + if (! empty($this->groupStack)) { $action['uses'] = $this->prependGroupUses($action['uses']); } @@ -875,7 +875,7 @@ class Router implements RegistrarContract */ protected function parseFilter($callback) { - if (is_string($callback) && !Str::contains($callback, '@')) { + if (is_string($callback) && ! Str::contains($callback, '@')) { return $callback.'@filter'; } @@ -894,7 +894,7 @@ class Router implements RegistrarContract */ public function when($pattern, $name, $methods = null) { - if (!is_null($methods)) { + if (! is_null($methods)) { $methods = array_map('strtoupper', (array) $methods); } @@ -913,7 +913,7 @@ class Router implements RegistrarContract */ public function whenRegex($pattern, $name, $methods = null) { - if (!is_null($methods)) { + if (! is_null($methods)) { $methods = array_map('strtoupper', (array) $methods); } @@ -1059,7 +1059,7 @@ class Router implements RegistrarContract foreach ($this->findPatternFilters($request) as $filter => $parameters) { $response = $this->callRouteFilter($filter, $parameters, $route, $request); - if (!is_null($response)) { + if (! is_null($response)) { return $response; } } @@ -1155,7 +1155,7 @@ class Router implements RegistrarContract foreach ($route->beforeFilters() as $filter => $parameters) { $response = $this->callRouteFilter($filter, $parameters, $route, $request); - if (!is_null($response)) { + if (! is_null($response)) { return $response; } } @@ -1206,7 +1206,7 @@ class Router implements RegistrarContract protected function cleanFilterParameters(array $parameters) { return array_filter($parameters, function ($p) { - return !is_null($p) && $p !== ''; + return ! is_null($p) && $p !== ''; }); } @@ -1221,7 +1221,7 @@ class Router implements RegistrarContract { if ($response instanceof PsrResponseInterface) { $response = (new HttpFoundationFactory)->createResponse($response); - } elseif (!$response instanceof SymfonyResponse) { + } elseif (! $response instanceof SymfonyResponse) { $response = new Response($response); } @@ -1235,7 +1235,7 @@ class Router implements RegistrarContract */ public function hasGroupStack() { - return !empty($this->groupStack); + return ! empty($this->groupStack); } /** @@ -1336,7 +1336,7 @@ class Router implements RegistrarContract */ public function currentRouteAction() { - if (!$this->current()) { + if (! $this->current()) { return; } diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 0691502d95..e1e143e164 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -271,7 +271,7 @@ class UrlGenerator implements UrlGeneratorContract */ public function route($name, $parameters = [], $absolute = true) { - if (!is_null($route = $this->routes->getByName($name))) { + if (! is_null($route = $this->routes->getByName($name))) { return $this->toRoute($route, $parameters, $absolute); } @@ -358,7 +358,7 @@ class UrlGenerator implements UrlGeneratorContract // If the URI has a fragment, we will move it to the end of the URI since it will // need to come after any query string that may be added to the URL else it is // not going to be available. We will remove it then append it back on here. - if (!is_null($fragment = parse_url($uri, PHP_URL_FRAGMENT))) { + if (! is_null($fragment = parse_url($uri, PHP_URL_FRAGMENT))) { $uri = preg_replace('/#.*/', '', $uri); } @@ -497,7 +497,7 @@ class UrlGenerator implements UrlGeneratorContract $port = (int) $this->request->getPort(); - if (($secure && $port === 443) || (!$secure && $port === 80)) { + if (($secure && $port === 443) || (! $secure && $port === 80)) { return $domain; } @@ -545,13 +545,13 @@ class UrlGenerator implements UrlGeneratorContract */ public function action($action, $parameters = [], $absolute = true) { - if ($this->rootNamespace && !(strpos($action, '\\') === 0)) { + if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) { $action = $this->rootNamespace.'\\'.$action; } else { $action = trim($action, '\\'); } - if (!is_null($route = $this->routes->getByAction($action))) { + if (! is_null($route = $this->routes->getByAction($action))) { return $this->toRoute($route, $parameters, $absolute); } diff --git a/src/Illuminate/Session/CacheBasedSessionHandler.php b/src/Illuminate/Session/CacheBasedSessionHandler.php index 06aa4f86f9..a2990bdd1e 100755 --- a/src/Illuminate/Session/CacheBasedSessionHandler.php +++ b/src/Illuminate/Session/CacheBasedSessionHandler.php @@ -35,7 +35,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function open($savePath, $sessionName) { @@ -43,7 +43,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function close() { @@ -51,7 +51,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function read($sessionId) { @@ -59,7 +59,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function write($sessionId, $data) { @@ -67,7 +67,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function destroy($sessionId) { @@ -75,7 +75,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function gc($lifetime) { diff --git a/src/Illuminate/Session/CookieSessionHandler.php b/src/Illuminate/Session/CookieSessionHandler.php index 5757b57fcc..e377c946e4 100755 --- a/src/Illuminate/Session/CookieSessionHandler.php +++ b/src/Illuminate/Session/CookieSessionHandler.php @@ -36,7 +36,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function open($savePath, $sessionName) { @@ -44,7 +44,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function close() { @@ -52,7 +52,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function read($sessionId) { @@ -60,7 +60,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function write($sessionId, $data) { @@ -68,7 +68,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function destroy($sessionId) { @@ -76,7 +76,7 @@ class CookieSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function gc($lifetime) { diff --git a/src/Illuminate/Session/DatabaseSessionHandler.php b/src/Illuminate/Session/DatabaseSessionHandler.php index a10faeb594..5fdc823fdc 100644 --- a/src/Illuminate/Session/DatabaseSessionHandler.php +++ b/src/Illuminate/Session/DatabaseSessionHandler.php @@ -42,7 +42,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function open($savePath, $sessionName) { @@ -50,7 +50,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function close() { @@ -58,7 +58,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function read($sessionId) { @@ -72,7 +72,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function write($sessionId, $data) { @@ -90,7 +90,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function destroy($sessionId) { @@ -98,7 +98,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI } /** - * {@inheritDoc} + * {@inheritdoc} */ public function gc($lifetime) { diff --git a/src/Illuminate/Session/FileSessionHandler.php b/src/Illuminate/Session/FileSessionHandler.php index 40e64f52cd..b2e0dde0f7 100644 --- a/src/Illuminate/Session/FileSessionHandler.php +++ b/src/Illuminate/Session/FileSessionHandler.php @@ -36,7 +36,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function open($savePath, $sessionName) { @@ -44,7 +44,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function close() { @@ -52,7 +52,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function read($sessionId) { @@ -64,7 +64,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function write($sessionId, $data) { @@ -72,7 +72,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function destroy($sessionId) { @@ -80,7 +80,7 @@ class FileSessionHandler implements SessionHandlerInterface } /** - * {@inheritDoc} + * {@inheritdoc} */ public function gc($lifetime) { diff --git a/src/Illuminate/Session/Middleware/StartSession.php b/src/Illuminate/Session/Middleware/StartSession.php index 26c9eee304..cf216e93d8 100644 --- a/src/Illuminate/Session/Middleware/StartSession.php +++ b/src/Illuminate/Session/Middleware/StartSession.php @@ -84,7 +84,7 @@ class StartSession */ public function terminate($request, $response) { - if ($this->sessionHandled && $this->sessionConfigured() && !$this->usingCookieSessions()) { + if ($this->sessionHandled && $this->sessionConfigured() && ! $this->usingCookieSessions()) { $this->manager->driver()->save(); } } @@ -128,7 +128,7 @@ class StartSession */ protected function storeCurrentUrl(Request $request, $session) { - if ($request->method() === 'GET' && $request->route() && !$request->ajax()) { + if ($request->method() === 'GET' && $request->route() && ! $request->ajax()) { $session->setPreviousUrl($request->fullUrl()); } } @@ -212,7 +212,7 @@ class StartSession */ protected function sessionConfigured() { - return !is_null(Arr::get($this->manager->getSessionConfig(), 'driver')); + return ! is_null(Arr::get($this->manager->getSessionConfig(), 'driver')); } /** @@ -225,7 +225,7 @@ class StartSession { $config = $config ?: $this->manager->getSessionConfig(); - return !in_array($config['driver'], [null, 'array']); + return ! in_array($config['driver'], [null, 'array']); } /** @@ -235,7 +235,7 @@ class StartSession */ protected function usingCookieSessions() { - if (!$this->sessionConfigured()) { + if (! $this->sessionConfigured()) { return false; } diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index 5069f7e76f..64749e67fd 100755 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -91,7 +91,7 @@ class Store implements SessionInterface { $this->loadSession(); - if (!$this->has('_token')) { + if (! $this->has('_token')) { $this->regenerateToken(); } @@ -169,7 +169,7 @@ class Store implements SessionInterface */ public function setId($id) { - if (!$this->isValidId($id)) { + if (! $this->isValidId($id)) { $id = $this->generateSessionId(); } @@ -308,7 +308,7 @@ class Store implements SessionInterface */ public function has($name) { - return !is_null($this->get($name)); + return ! is_null($this->get($name)); } /** @@ -341,7 +341,7 @@ class Store implements SessionInterface { $old = $this->getOldInput($key); - return is_null($key) ? count($old) > 0 : !is_null($old); + return is_null($key) ? count($old) > 0 : ! is_null($old); } /** @@ -378,7 +378,7 @@ class Store implements SessionInterface */ public function put($key, $value = null) { - if (!is_array($key)) { + if (! is_array($key)) { $key = [$key => $value]; } diff --git a/src/Illuminate/Support/Arr.php b/src/Illuminate/Support/Arr.php index 175ce05ea0..5ee0bc333b 100755 --- a/src/Illuminate/Support/Arr.php +++ b/src/Illuminate/Support/Arr.php @@ -234,7 +234,7 @@ class Arr } foreach (explode('.', $key) as $segment) { - if (!is_array($array) || !array_key_exists($segment, $array)) { + if (! is_array($array) || ! array_key_exists($segment, $array)) { return value($default); } @@ -262,7 +262,7 @@ class Arr } foreach (explode('.', $key) as $segment) { - if (!is_array($array) || !array_key_exists($segment, $array)) { + if (! is_array($array) || ! array_key_exists($segment, $array)) { return false; } @@ -388,7 +388,7 @@ class Arr // If the key doesn't exist at this depth, we will just create an empty array // to hold the next value, allowing us to create the arrays to hold final // values at the correct depth. Then we'll keep digging into the array. - if (!isset($array[$key]) || !is_array($array[$key])) { + if (! isset($array[$key]) || ! is_array($array[$key])) { $array[$key] = []; } diff --git a/src/Illuminate/Support/ClassLoader.php b/src/Illuminate/Support/ClassLoader.php index f7591a7520..97ac5d67ef 100644 --- a/src/Illuminate/Support/ClassLoader.php +++ b/src/Illuminate/Support/ClassLoader.php @@ -61,7 +61,7 @@ class ClassLoader */ public static function register() { - if (!static::$registered) { + if (! static::$registered) { static::$registered = spl_autoload_register(['\Illuminate\Support\ClassLoader', 'load']); } } diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index 216091cc80..34b895385e 100755 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -79,7 +79,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } if ($this->useAsCallable($key)) { - return !is_null($this->first($key)); + return ! is_null($this->first($key)); } return in_array($key, $this->items); @@ -250,7 +250,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate foreach ($this->items as $key => $value) { $groupKey = $groupBy($value, $key); - if (!array_key_exists($groupKey, $results)) { + if (! array_key_exists($groupKey, $results)) { $results[$groupKey] = new static; } @@ -337,7 +337,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate */ protected function useAsCallable($value) { - return !is_string($value) && is_callable($value); + return ! is_string($value) && is_callable($value); } /** @@ -565,7 +565,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate { if ($this->useAsCallable($callback)) { return $this->filter(function ($item) use ($callback) { - return !$callback($item); + return ! $callback($item); }); } @@ -593,7 +593,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate */ public function search($value, $strict = false) { - if (!$this->useAsCallable($value)) { + if (! $this->useAsCallable($value)) { return array_search($value, $this->items, $strict); } diff --git a/src/Illuminate/Support/Facades/Cookie.php b/src/Illuminate/Support/Facades/Cookie.php index c97e3f843d..bbcd5a30fd 100755 --- a/src/Illuminate/Support/Facades/Cookie.php +++ b/src/Illuminate/Support/Facades/Cookie.php @@ -15,7 +15,7 @@ class Cookie extends Facade */ public static function has($key) { - return !is_null(static::$app['request']->cookie($key, null)); + return ! is_null(static::$app['request']->cookie($key, null)); } /** diff --git a/src/Illuminate/Support/HtmlString.php b/src/Illuminate/Support/HtmlString.php index e73520b6ac..8d246cff05 100644 --- a/src/Illuminate/Support/HtmlString.php +++ b/src/Illuminate/Support/HtmlString.php @@ -7,7 +7,7 @@ use Illuminate\Contracts\Support\Htmlable; class HtmlString implements Htmlable { /** - * The HTML string + * The HTML string. * * @var string */ @@ -25,7 +25,7 @@ class HtmlString implements Htmlable } /** - * Get the the HTML string + * Get the the HTML string. * * @return string */ @@ -35,7 +35,7 @@ class HtmlString implements Htmlable } /** - * Get the the HTML string + * Get the the HTML string. * * @return string */ diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index 564c83146b..29154c61a5 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -59,7 +59,7 @@ abstract class Manager // If the given driver has not been created before, we will create the instances // here and cache it so we can return it next time very quickly. If there is // already a driver created by this name, we'll just return that instance. - if (!isset($this->drivers[$driver])) { + if (! isset($this->drivers[$driver])) { $this->drivers[$driver] = $this->createDriver($driver); } diff --git a/src/Illuminate/Support/MessageBag.php b/src/Illuminate/Support/MessageBag.php index a877a1ce7f..a58b154873 100755 --- a/src/Illuminate/Support/MessageBag.php +++ b/src/Illuminate/Support/MessageBag.php @@ -92,7 +92,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me { $messages = (array) $this->messages; - return !isset($messages[$key]) || !in_array($message, $messages[$key]); + return ! isset($messages[$key]) || ! in_array($message, $messages[$key]); } /** @@ -243,7 +243,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me */ public function isEmpty() { - return !$this->any(); + return ! $this->any(); } /** diff --git a/src/Illuminate/Support/ServiceProvider.php b/src/Illuminate/Support/ServiceProvider.php index 8cb1a8edf5..f512c230d2 100755 --- a/src/Illuminate/Support/ServiceProvider.php +++ b/src/Illuminate/Support/ServiceProvider.php @@ -105,14 +105,14 @@ abstract class ServiceProvider { $class = get_class($this); - if (!array_key_exists($class, static::$publishes)) { + if (! array_key_exists($class, static::$publishes)) { static::$publishes[$class] = []; } static::$publishes[$class] = array_merge(static::$publishes[$class], $paths); if ($group) { - if (!array_key_exists($group, static::$publishGroups)) { + if (! array_key_exists($group, static::$publishGroups)) { static::$publishGroups[$group] = []; } diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index 44bb98caac..a3a4be80eb 100755 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -181,7 +181,7 @@ class Str { preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); - if (!isset($matches[0]) || strlen($value) === strlen($matches[0])) { + if (! isset($matches[0]) || strlen($value) === strlen($matches[0])) { return $value; } @@ -288,11 +288,11 @@ class Str */ public static function equals($knownString, $userInput) { - if (!is_string($knownString)) { + if (! is_string($knownString)) { $knownString = (string) $knownString; } - if (!is_string($userInput)) { + if (! is_string($userInput)) { $userInput = (string) $userInput; } @@ -388,7 +388,7 @@ class Str return static::$snakeCache[$key]; } - if (!ctype_lower($value)) { + if (! ctype_lower($value)) { $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1'.$delimiter, $value)); $value = preg_replace('/\s+/', '', $value); diff --git a/src/Illuminate/Support/Traits/CapsuleManagerTrait.php b/src/Illuminate/Support/Traits/CapsuleManagerTrait.php index 4029a8a9ae..08089ef661 100644 --- a/src/Illuminate/Support/Traits/CapsuleManagerTrait.php +++ b/src/Illuminate/Support/Traits/CapsuleManagerTrait.php @@ -31,7 +31,7 @@ trait CapsuleManagerTrait { $this->container = $container; - if (!$this->container->bound('config')) { + if (! $this->container->bound('config')) { $this->container->instance('config', new Fluent); } } diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 92fa4da619..65b28e4e08 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -6,7 +6,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Debug\Dumper; use Illuminate\Contracts\Support\Htmlable; -if (!function_exists('append_config')) { +if (! function_exists('append_config')) { /** * Assign high numeric IDs to a config item to force appending. * @@ -29,7 +29,7 @@ if (!function_exists('append_config')) { } } -if (!function_exists('array_add')) { +if (! function_exists('array_add')) { /** * Add an element to an array using "dot" notation if it doesn't exist. * @@ -44,7 +44,7 @@ if (!function_exists('array_add')) { } } -if (!function_exists('array_build')) { +if (! function_exists('array_build')) { /** * Build a new array using a callback. * @@ -58,7 +58,7 @@ if (!function_exists('array_build')) { } } -if (!function_exists('array_collapse')) { +if (! function_exists('array_collapse')) { /** * Collapse an array of arrays into a single array. * @@ -71,7 +71,7 @@ if (!function_exists('array_collapse')) { } } -if (!function_exists('array_divide')) { +if (! function_exists('array_divide')) { /** * Divide an array into two arrays. One with keys and the other with values. * @@ -84,7 +84,7 @@ if (!function_exists('array_divide')) { } } -if (!function_exists('array_dot')) { +if (! function_exists('array_dot')) { /** * Flatten a multi-dimensional associative array with dots. * @@ -98,7 +98,7 @@ if (!function_exists('array_dot')) { } } -if (!function_exists('array_except')) { +if (! function_exists('array_except')) { /** * Get all of the given array except for a specified array of items. * @@ -112,7 +112,7 @@ if (!function_exists('array_except')) { } } -if (!function_exists('array_fetch')) { +if (! function_exists('array_fetch')) { /** * Fetch a flattened array of a nested array element. * @@ -128,7 +128,7 @@ if (!function_exists('array_fetch')) { } } -if (!function_exists('array_first')) { +if (! function_exists('array_first')) { /** * Return the first element in an array passing a given truth test. * @@ -143,7 +143,7 @@ if (!function_exists('array_first')) { } } -if (!function_exists('array_last')) { +if (! function_exists('array_last')) { /** * Return the last element in an array passing a given truth test. * @@ -158,7 +158,7 @@ if (!function_exists('array_last')) { } } -if (!function_exists('array_flatten')) { +if (! function_exists('array_flatten')) { /** * Flatten a multi-dimensional array into a single level. * @@ -171,7 +171,7 @@ if (!function_exists('array_flatten')) { } } -if (!function_exists('array_forget')) { +if (! function_exists('array_forget')) { /** * Remove one or many array items from a given array using "dot" notation. * @@ -185,7 +185,7 @@ if (!function_exists('array_forget')) { } } -if (!function_exists('array_get')) { +if (! function_exists('array_get')) { /** * Get an item from an array using "dot" notation. * @@ -200,7 +200,7 @@ if (!function_exists('array_get')) { } } -if (!function_exists('array_has')) { +if (! function_exists('array_has')) { /** * Check if an item exists in an array using "dot" notation. * @@ -214,7 +214,7 @@ if (!function_exists('array_has')) { } } -if (!function_exists('array_only')) { +if (! function_exists('array_only')) { /** * Get a subset of the items from the given array. * @@ -228,7 +228,7 @@ if (!function_exists('array_only')) { } } -if (!function_exists('array_pluck')) { +if (! function_exists('array_pluck')) { /** * Pluck an array of values from an array. * @@ -243,7 +243,7 @@ if (!function_exists('array_pluck')) { } } -if (!function_exists('array_pull')) { +if (! function_exists('array_pull')) { /** * Get a value from the array, and remove it. * @@ -258,7 +258,7 @@ if (!function_exists('array_pull')) { } } -if (!function_exists('array_set')) { +if (! function_exists('array_set')) { /** * Set an array item to a given value using "dot" notation. * @@ -275,7 +275,7 @@ if (!function_exists('array_set')) { } } -if (!function_exists('array_sort')) { +if (! function_exists('array_sort')) { /** * Sort the array using the given callback. * @@ -289,7 +289,7 @@ if (!function_exists('array_sort')) { } } -if (!function_exists('array_sort_recursive')) { +if (! function_exists('array_sort_recursive')) { /** * Recursively sort an array by keys and values. * @@ -302,7 +302,7 @@ if (!function_exists('array_sort_recursive')) { } } -if (!function_exists('array_where')) { +if (! function_exists('array_where')) { /** * Filter the array using the given callback. * @@ -316,7 +316,7 @@ if (!function_exists('array_where')) { } } -if (!function_exists('camel_case')) { +if (! function_exists('camel_case')) { /** * Convert a value to camel case. * @@ -329,7 +329,7 @@ if (!function_exists('camel_case')) { } } -if (!function_exists('class_basename')) { +if (! function_exists('class_basename')) { /** * Get the class "basename" of the given object / class. * @@ -344,7 +344,7 @@ if (!function_exists('class_basename')) { } } -if (!function_exists('class_uses_recursive')) { +if (! function_exists('class_uses_recursive')) { /** * Returns all traits used by a class, its subclasses and trait of their traits. * @@ -363,7 +363,7 @@ if (!function_exists('class_uses_recursive')) { } } -if (!function_exists('collect')) { +if (! function_exists('collect')) { /** * Create a collection from the given value. * @@ -376,7 +376,7 @@ if (!function_exists('collect')) { } } -if (!function_exists('data_get')) { +if (! function_exists('data_get')) { /** * Get an item from an array or object using "dot" notation. * @@ -395,19 +395,19 @@ if (!function_exists('data_get')) { foreach ($key as $segment) { if (is_array($target)) { - if (!array_key_exists($segment, $target)) { + if (! array_key_exists($segment, $target)) { return value($default); } $target = $target[$segment]; } elseif ($target instanceof ArrayAccess) { - if (!isset($target[$segment])) { + if (! isset($target[$segment])) { return value($default); } $target = $target[$segment]; } elseif (is_object($target)) { - if (!isset($target->{$segment})) { + if (! isset($target->{$segment})) { return value($default); } @@ -421,7 +421,7 @@ if (!function_exists('data_get')) { } } -if (!function_exists('dd')) { +if (! function_exists('dd')) { /** * Dump the passed variables and end the script. * @@ -438,7 +438,7 @@ if (!function_exists('dd')) { } } -if (!function_exists('e')) { +if (! function_exists('e')) { /** * Escape HTML entities in a string. * @@ -455,7 +455,7 @@ if (!function_exists('e')) { } } -if (!function_exists('ends_with')) { +if (! function_exists('ends_with')) { /** * Determine if a given string ends with a given substring. * @@ -469,7 +469,7 @@ if (!function_exists('ends_with')) { } } -if (!function_exists('head')) { +if (! function_exists('head')) { /** * Get the first element of an array. Useful for method chaining. * @@ -482,7 +482,7 @@ if (!function_exists('head')) { } } -if (!function_exists('last')) { +if (! function_exists('last')) { /** * Get the last element from an array. * @@ -495,7 +495,7 @@ if (!function_exists('last')) { } } -if (!function_exists('object_get')) { +if (! function_exists('object_get')) { /** * Get an item from an object using "dot" notation. * @@ -511,7 +511,7 @@ if (!function_exists('object_get')) { } foreach (explode('.', $key) as $segment) { - if (!is_object($object) || !isset($object->{$segment})) { + if (! is_object($object) || ! isset($object->{$segment})) { return value($default); } @@ -522,7 +522,7 @@ if (!function_exists('object_get')) { } } -if (!function_exists('preg_replace_sub')) { +if (! function_exists('preg_replace_sub')) { /** * Replace a given pattern with each value in the array in sequentially. * @@ -542,7 +542,7 @@ if (!function_exists('preg_replace_sub')) { } } -if (!function_exists('snake_case')) { +if (! function_exists('snake_case')) { /** * Convert a string to snake case. * @@ -556,7 +556,7 @@ if (!function_exists('snake_case')) { } } -if (!function_exists('starts_with')) { +if (! function_exists('starts_with')) { /** * Determine if a given string starts with a given substring. * @@ -570,7 +570,7 @@ if (!function_exists('starts_with')) { } } -if (!function_exists('str_contains')) { +if (! function_exists('str_contains')) { /** * Determine if a given string contains a given substring. * @@ -584,7 +584,7 @@ if (!function_exists('str_contains')) { } } -if (!function_exists('str_finish')) { +if (! function_exists('str_finish')) { /** * Cap a string with a single instance of a given value. * @@ -598,7 +598,7 @@ if (!function_exists('str_finish')) { } } -if (!function_exists('str_is')) { +if (! function_exists('str_is')) { /** * Determine if a given string matches a given pattern. * @@ -612,7 +612,7 @@ if (!function_exists('str_is')) { } } -if (!function_exists('str_limit')) { +if (! function_exists('str_limit')) { /** * Limit the number of characters in a string. * @@ -627,7 +627,7 @@ if (!function_exists('str_limit')) { } } -if (!function_exists('str_plural')) { +if (! function_exists('str_plural')) { /** * Get the plural form of an English word. * @@ -641,7 +641,7 @@ if (!function_exists('str_plural')) { } } -if (!function_exists('str_random')) { +if (! function_exists('str_random')) { /** * Generate a more truly "random" alpha-numeric string. * @@ -656,7 +656,7 @@ if (!function_exists('str_random')) { } } -if (!function_exists('str_replace_array')) { +if (! function_exists('str_replace_array')) { /** * Replace a given value in the string sequentially with an array. * @@ -675,7 +675,7 @@ if (!function_exists('str_replace_array')) { } } -if (!function_exists('str_singular')) { +if (! function_exists('str_singular')) { /** * Get the singular form of an English word. * @@ -688,7 +688,7 @@ if (!function_exists('str_singular')) { } } -if (!function_exists('str_slug')) { +if (! function_exists('str_slug')) { /** * Generate a URL friendly "slug" from a given string. * @@ -702,7 +702,7 @@ if (!function_exists('str_slug')) { } } -if (!function_exists('studly_case')) { +if (! function_exists('studly_case')) { /** * Convert a value to studly caps case. * @@ -715,7 +715,7 @@ if (!function_exists('studly_case')) { } } -if (!function_exists('title_case')) { +if (! function_exists('title_case')) { /** * Convert a value to title case. * @@ -728,7 +728,7 @@ if (!function_exists('title_case')) { } } -if (!function_exists('trait_uses_recursive')) { +if (! function_exists('trait_uses_recursive')) { /** * Returns all traits used by a trait and its traits. * @@ -747,7 +747,7 @@ if (!function_exists('trait_uses_recursive')) { } } -if (!function_exists('value')) { +if (! function_exists('value')) { /** * Return the default value of the given value. * @@ -760,7 +760,7 @@ if (!function_exists('value')) { } } -if (!function_exists('with')) { +if (! function_exists('with')) { /** * Return the given object. Useful for chaining. * diff --git a/src/Illuminate/Translation/Translator.php b/src/Illuminate/Translation/Translator.php index e2c829d0a1..3ac09a4b32 100755 --- a/src/Illuminate/Translation/Translator.php +++ b/src/Illuminate/Translation/Translator.php @@ -85,7 +85,7 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface $namespace, $group, $locale, $item, $replace ); - if (!is_null($line)) { + if (! is_null($line)) { break; } } @@ -93,7 +93,7 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface // If the line doesn't exist, we will return back the key which was requested as // that will be quick to spot in the UI if language keys are wrong or missing // from the application's language files. Otherwise we can return the line. - if (!isset($line)) { + if (! isset($line)) { return $key; } @@ -271,7 +271,7 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface */ protected function parseLocale($locale) { - if (!is_null($locale)) { + if (! is_null($locale)) { return array_filter([$locale, $this->fallback]); } @@ -285,7 +285,7 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface */ public function getSelector() { - if (!isset($this->selector)) { + if (! isset($this->selector)) { $this->selector = new MessageSelector; } diff --git a/src/Illuminate/Validation/DatabasePresenceVerifier.php b/src/Illuminate/Validation/DatabasePresenceVerifier.php index 339beb90d7..1704f3732a 100755 --- a/src/Illuminate/Validation/DatabasePresenceVerifier.php +++ b/src/Illuminate/Validation/DatabasePresenceVerifier.php @@ -46,7 +46,7 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface { $query = $this->table($collection)->where($column, '=', $value); - if (!is_null($excludeId) && $excludeId != 'NULL') { + if (! is_null($excludeId) && $excludeId != 'NULL') { $query->where($idColumn ?: 'id', '<>', $excludeId); } diff --git a/src/Illuminate/Validation/Factory.php b/src/Illuminate/Validation/Factory.php index 60d0400ad0..bbc5e2251c 100755 --- a/src/Illuminate/Validation/Factory.php +++ b/src/Illuminate/Validation/Factory.php @@ -95,14 +95,14 @@ class Factory implements FactoryContract // it may be written besides database. We'll inject it into the validator. $validator = $this->resolve($data, $rules, $messages, $customAttributes); - if (!is_null($this->verifier)) { + if (! is_null($this->verifier)) { $validator->setPresenceVerifier($this->verifier); } // Next we'll set the IoC container instance of the validator, which is used to // resolve out class based validator extensions. If it is not set then these // types of extensions will not be possible on these validation instances. - if (!is_null($this->container)) { + if (! is_null($this->container)) { $validator->setContainer($this->container); } diff --git a/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php b/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php index 052cfdd4d2..bc1fd966c2 100644 --- a/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php +++ b/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php @@ -19,9 +19,9 @@ trait ValidatesWhenResolvedTrait { $instance = $this->getValidatorInstance(); - if (!$this->passesAuthorization()) { + if (! $this->passesAuthorization()) { $this->failedAuthorization(); - } elseif (!$instance->passes()) { + } elseif (! $instance->passes()) { $this->failedValidation($instance); } } diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index 42bac7f188..a9e98e29c9 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -262,7 +262,7 @@ class Validator implements ValidatorContract { $data = Arr::get($this->data, $attribute); - if (!is_array($data)) { + if (! is_array($data)) { if ($this->hasRule($attribute, 'Array')) { return; } @@ -272,7 +272,7 @@ class Validator implements ValidatorContract foreach ($data as $dataKey => $dataValue) { foreach ((array) $rules as $ruleKey => $ruleValue) { - if (!is_string($ruleKey)) { + if (! is_string($ruleKey)) { $this->mergeRules("$attribute.$dataKey", $ruleValue); } else { $this->mergeRules("$attribute.$dataKey.$ruleKey", $ruleValue); @@ -332,7 +332,7 @@ class Validator implements ValidatorContract */ public function fails() { - return !$this->passes(); + return ! $this->passes(); } /** @@ -359,7 +359,7 @@ class Validator implements ValidatorContract $method = "validate{$rule}"; - if ($validatable && !$this->$method($attribute, $value, $parameters, $this)) { + if ($validatable && ! $this->$method($attribute, $value, $parameters, $this)) { $this->addFailure($attribute, $rule, $parameters); } } @@ -371,7 +371,7 @@ class Validator implements ValidatorContract */ public function valid() { - if (!$this->messages) { + if (! $this->messages) { $this->passes(); } @@ -385,7 +385,7 @@ class Validator implements ValidatorContract */ public function invalid() { - if (!$this->messages) { + if (! $this->messages) { $this->passes(); } @@ -400,9 +400,9 @@ class Validator implements ValidatorContract */ protected function getValue($attribute) { - if (!is_null($value = Arr::get($this->data, $attribute))) { + if (! is_null($value = Arr::get($this->data, $attribute))) { return $value; - } elseif (!is_null($value = Arr::get($this->files, $attribute))) { + } elseif (! is_null($value = Arr::get($this->files, $attribute))) { return $value; } } @@ -475,7 +475,7 @@ class Validator implements ValidatorContract protected function hasNotFailedPreviousRuleIfPresenceRule($rule, $attribute) { return in_array($rule, ['Unique', 'Exists']) - ? !$this->messages->has($attribute) : true; + ? ! $this->messages->has($attribute) : true; } /** @@ -569,7 +569,7 @@ class Validator implements ValidatorContract protected function anyFailingRequired(array $attributes) { foreach ($attributes as $key) { - if (!$this->validateRequired($key, $this->getValue($key))) { + if (! $this->validateRequired($key, $this->getValue($key))) { return true; } } @@ -604,7 +604,7 @@ class Validator implements ValidatorContract */ protected function validateRequiredWith($attribute, $value, $parameters) { - if (!$this->allFailingRequired($parameters)) { + if (! $this->allFailingRequired($parameters)) { return $this->validateRequired($attribute, $value); } @@ -621,7 +621,7 @@ class Validator implements ValidatorContract */ protected function validateRequiredWithAll($attribute, $value, $parameters) { - if (!$this->anyFailingRequired($parameters)) { + if (! $this->anyFailingRequired($parameters)) { return $this->validateRequired($attribute, $value); } @@ -921,7 +921,7 @@ class Validator implements ValidatorContract { $this->requireParameterCount(1, $parameters, 'max'); - if ($value instanceof UploadedFile && !$value->isValid()) { + if ($value instanceof UploadedFile && ! $value->isValid()) { return false; } @@ -981,7 +981,7 @@ class Validator implements ValidatorContract */ protected function validateNotIn($attribute, $value, $parameters) { - return !$this->validateIn($attribute, $value, $parameters); + return ! $this->validateIn($attribute, $value, $parameters); } /** @@ -1020,7 +1020,7 @@ class Validator implements ValidatorContract // data store like Redis, etc. We will use it to determine uniqueness. $verifier = $this->getPresenceVerifier(); - if (!is_null($connection)) { + if (! is_null($connection)) { $verifier->setConnection($connection); } @@ -1220,7 +1220,7 @@ class Validator implements ValidatorContract */ protected function validateMimes($attribute, $value, $parameters) { - if (!$this->isAValidFileInstance($value)) { + if (! $this->isAValidFileInstance($value)) { return false; } @@ -1237,7 +1237,7 @@ class Validator implements ValidatorContract */ protected function validateMimetypes($attribute, $value, $parameters) { - if (!$this->isAValidFileInstance($value)) { + if (! $this->isAValidFileInstance($value)) { return false; } @@ -1252,7 +1252,7 @@ class Validator implements ValidatorContract */ protected function isAValidFileInstance($value) { - if ($value instanceof UploadedFile && !$value->isValid()) { + if ($value instanceof UploadedFile && ! $value->isValid()) { return false; } @@ -1381,7 +1381,7 @@ class Validator implements ValidatorContract return $this->validateBeforeWithFormat($format, $value, $parameters); } - if (!($date = strtotime($parameters[0]))) { + if (! ($date = strtotime($parameters[0]))) { return strtotime($value) < strtotime($this->getValue($parameters[0])); } @@ -1419,7 +1419,7 @@ class Validator implements ValidatorContract return $this->validateAfterWithFormat($format, $value, $parameters); } - if (!($date = strtotime($parameters[0]))) { + if (! ($date = strtotime($parameters[0]))) { return strtotime($value) > strtotime($this->getValue($parameters[0])); } @@ -1527,7 +1527,7 @@ class Validator implements ValidatorContract // First we will retrieve the custom message for the validation rule if one // exists. If a custom validation message is being used we'll return the // custom message, otherwise we'll keep searching for a valid message. - if (!is_null($inlineMessage)) { + if (! is_null($inlineMessage)) { return $inlineMessage; } @@ -1983,7 +1983,7 @@ class Validator implements ValidatorContract */ protected function replaceBefore($message, $attribute, $rule, $parameters) { - if (!(strtotime($parameters[0]))) { + if (! (strtotime($parameters[0]))) { return str_replace(':date', $this->getAttribute($parameters[0]), $message); } @@ -2013,7 +2013,7 @@ class Validator implements ValidatorContract */ protected function hasRule($attribute, $rules) { - return !is_null($this->getRule($attribute, $rules)); + return ! is_null($this->getRule($attribute, $rules)); } /** @@ -2025,7 +2025,7 @@ class Validator implements ValidatorContract */ protected function getRule($attribute, $rules) { - if (!array_key_exists($attribute, $this->rules)) { + if (! array_key_exists($attribute, $this->rules)) { return; } @@ -2313,7 +2313,7 @@ class Validator implements ValidatorContract */ public function getPresenceVerifier() { - if (!isset($this->presenceVerifier)) { + if (! isset($this->presenceVerifier)) { throw new RuntimeException('Presence verifier has not been set.'); } @@ -2457,7 +2457,7 @@ class Validator implements ValidatorContract */ public function messages() { - if (!$this->messages) { + if (! $this->messages) { $this->passes(); } diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index b35f74f962..485fdfa5e9 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -98,7 +98,7 @@ class BladeCompiler extends Compiler implements CompilerInterface $contents = $this->compileString($this->files->get($this->getPath())); - if (!is_null($this->cachePath)) { + if (! is_null($this->cachePath)) { $this->files->put($this->getCompiledPath($this->getPath()), $contents); } } @@ -391,7 +391,7 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileShow($expression) { - return "yieldSection(); ?>"; + return 'yieldSection(); ?>'; } /** @@ -413,7 +413,7 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileAppend($expression) { - return "appendSection(); ?>"; + return 'appendSection(); ?>'; } /** @@ -424,7 +424,7 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileEndsection($expression) { - return "stopSection(); ?>"; + return 'stopSection(); ?>'; } /** @@ -435,7 +435,7 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileStop($expression) { - return "stopSection(); ?>"; + return 'stopSection(); ?>'; } /** @@ -446,7 +446,7 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileOverwrite($expression) { - return "stopSection(true); ?>"; + return 'stopSection(true); ?>'; } /** @@ -704,14 +704,14 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected function compileEndpush($expression) { - return "appendSection(); ?>"; + return 'appendSection(); ?>'; } /** - * Get the extensions used by the compiler. - * - * @return array - */ + * Get the extensions used by the compiler. + * + * @return array + */ public function getExtensions() { return $this->extensions; @@ -751,10 +751,10 @@ class BladeCompiler extends Compiler implements CompilerInterface } /** - * Gets the raw tags used by the compiler. - * - * @return array - */ + * Gets the raw tags used by the compiler. + * + * @return array + */ public function getRawTags() { return $this->rawTags; diff --git a/src/Illuminate/View/Compilers/Compiler.php b/src/Illuminate/View/Compilers/Compiler.php index 3fe219a6bb..a11a6d5308 100755 --- a/src/Illuminate/View/Compilers/Compiler.php +++ b/src/Illuminate/View/Compilers/Compiler.php @@ -57,7 +57,7 @@ abstract class Compiler // If the compiled file doesn't exist we will indicate that the view is expired // so that it can be re-compiled. Else, we will verify the last modification // of the views is less than the modification times of the compiled views. - if (!$this->cachePath || !$this->files->exists($compiled)) { + if (! $this->cachePath || ! $this->files->exists($compiled)) { return true; } diff --git a/src/Illuminate/View/Expression.php b/src/Illuminate/View/Expression.php index e037bcac37..4749b23d7c 100644 --- a/src/Illuminate/View/Expression.php +++ b/src/Illuminate/View/Expression.php @@ -7,7 +7,7 @@ use Illuminate\Contracts\Support\Htmlable; class Expression implements Htmlable { /** - * The HTML string + * The HTML string. * * @var string */ @@ -25,7 +25,7 @@ class Expression implements Htmlable } /** - * Get the the HTML string + * Get the the HTML string. * * @return string */ @@ -35,7 +35,7 @@ class Expression implements Htmlable } /** - * Get the the HTML string + * Get the the HTML string. * * @return string */ diff --git a/src/Illuminate/View/Factory.php b/src/Illuminate/View/Factory.php index 97ef341c97..a8fc3f689f 100755 --- a/src/Illuminate/View/Factory.php +++ b/src/Illuminate/View/Factory.php @@ -288,7 +288,7 @@ class Factory implements FactoryContract */ public function getEngineFromPath($path) { - if (!$extension = $this->getExtension($path)) { + if (! $extension = $this->getExtension($path)) { throw new InvalidArgumentException("Unrecognized extension in file: $path"); } @@ -321,7 +321,7 @@ class Factory implements FactoryContract */ public function share($key, $value = null) { - if (!is_array($key)) { + if (! is_array($key)) { return $this->shared[$key] = $value; } diff --git a/src/Illuminate/View/FileViewFinder.php b/src/Illuminate/View/FileViewFinder.php index b68fdcda2a..ba92bd8c64 100755 --- a/src/Illuminate/View/FileViewFinder.php +++ b/src/Illuminate/View/FileViewFinder.php @@ -108,7 +108,7 @@ class FileViewFinder implements ViewFinderInterface throw new InvalidArgumentException("View [$name] has an invalid name."); } - if (!isset($this->hints[$segments[0]])) { + if (! isset($this->hints[$segments[0]])) { throw new InvalidArgumentException("No hint path defined for [{$segments[0]}]."); } diff --git a/tests/Cache/CacheRateLimiterTest.php b/tests/Cache/CacheRateLimiterTest.php index 3b85717d84..471d3a40e3 100644 --- a/tests/Cache/CacheRateLimiterTest.php +++ b/tests/Cache/CacheRateLimiterTest.php @@ -6,54 +6,50 @@ use Illuminate\Contracts\Cache\Repository as Cache; class CacheRateLimiterTest extends PHPUnit_Framework_TestCase { - public function tearDown() - { - m::close(); - } + public function tearDown() + { + m::close(); + } + public function testTooManyAttemptsReturnTrueIfAlreadyLockedOut() + { + $cache = m::mock(Cache::class); + $cache->shouldReceive('get')->once()->with('key', 0)->andReturn(0); + $cache->shouldReceive('has')->once()->with('key:lockout')->andReturn(true); + $cache->shouldReceive('add')->never(); + $rateLimiter = new RateLimiter($cache); - public function testTooManyAttemptsReturnTrueIfAlreadyLockedOut() - { - $cache = m::mock(Cache::class); - $cache->shouldReceive('get')->once()->with('key', 0)->andReturn(0); - $cache->shouldReceive('has')->once()->with('key:lockout')->andReturn(true); - $cache->shouldReceive('add')->never(); - $rateLimiter = new RateLimiter($cache); + $this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1)); + } - $this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1)); - } + public function testTooManyAttemptsReturnsTrueIfMaxAttemptsExceeded() + { + $cache = m::mock(Cache::class); + $cache->shouldReceive('get')->once()->with('key', 0)->andReturn(10); + $cache->shouldReceive('has')->once()->with('key:lockout')->andReturn(false); + $cache->shouldReceive('add')->once()->with('key:lockout', m::type('int'), 1); + $rateLimiter = new RateLimiter($cache); + $this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1)); + } - public function testTooManyAttemptsReturnsTrueIfMaxAttemptsExceeded() - { - $cache = m::mock(Cache::class); - $cache->shouldReceive('get')->once()->with('key', 0)->andReturn(10); - $cache->shouldReceive('has')->once()->with('key:lockout')->andReturn(false); - $cache->shouldReceive('add')->once()->with('key:lockout', m::type('int'), 1); - $rateLimiter = new RateLimiter($cache); + public function testHitProperlyIncrementsAttemptCount() + { + $cache = m::mock(Cache::class); + $cache->shouldReceive('add')->once()->with('key', 1, 1); + $cache->shouldReceive('increment')->once()->with('key'); + $rateLimiter = new RateLimiter($cache); - $this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1)); - } + $rateLimiter->hit('key', 1); + } + public function testClearClearsTheCacheKeys() + { + $cache = m::mock(Cache::class); + $cache->shouldReceive('forget')->once()->with('key'); + $cache->shouldReceive('forget')->once()->with('key:lockout'); + $rateLimiter = new RateLimiter($cache); - public function testHitProperlyIncrementsAttemptCount() - { - $cache = m::mock(Cache::class); - $cache->shouldReceive('add')->once()->with('key', 1, 1); - $cache->shouldReceive('increment')->once()->with('key'); - $rateLimiter = new RateLimiter($cache); - - $rateLimiter->hit('key', 1); - } - - - public function testClearClearsTheCacheKeys() - { - $cache = m::mock(Cache::class); - $cache->shouldReceive('forget')->once()->with('key'); - $cache->shouldReceive('forget')->once()->with('key:lockout'); - $rateLimiter = new RateLimiter($cache); - - $rateLimiter->clear('key'); - } + $rateLimiter->clear('key'); + } } diff --git a/tests/Cookie/Middleware/EncryptCookiesTest.php b/tests/Cookie/Middleware/EncryptCookiesTest.php index 92e29c0c0e..79c03bb53b 100644 --- a/tests/Cookie/Middleware/EncryptCookiesTest.php +++ b/tests/Cookie/Middleware/EncryptCookiesTest.php @@ -39,7 +39,7 @@ class EncryptCookiesTest extends PHPUnit_Framework_TestCase { $this->router->get($this->setCookiePath, [ 'middleware' => 'EncryptCookiesTestMiddleware', - 'uses' => 'EncryptCookiesTestController@setCookies' + 'uses' => 'EncryptCookiesTestController@setCookies', ]); $response = $this->router->dispatch(Request::create($this->setCookiePath, 'GET')); @@ -56,7 +56,7 @@ class EncryptCookiesTest extends PHPUnit_Framework_TestCase { $this->router->get($this->queueCookiePath, [ 'middleware' => ['EncryptCookiesTestMiddleware', 'AddQueuedCookiesToResponseTestMiddleware'], - 'uses' => 'EncryptCookiesTestController@queueCookies' + 'uses' => 'EncryptCookiesTestController@queueCookies', ]); $response = $this->router->dispatch(Request::create($this->queueCookiePath, 'GET')); diff --git a/tests/Database/DatabaseConnectorTest.php b/tests/Database/DatabaseConnectorTest.php index 59711e6808..cea0ffefb1 100755 --- a/tests/Database/DatabaseConnectorTest.php +++ b/tests/Database/DatabaseConnectorTest.php @@ -77,7 +77,7 @@ class DatabaseConnectorTest extends PHPUnit_Framework_TestCase { $dsn = 'pgsql:host=foo;dbname=bar'; $config = ['host' => 'foo', 'database' => 'bar', 'schema' => ['public', 'user'], 'charset' => 'utf8']; - $connector = $this->getMock('Illuminate\Database\Connectors\PostgresConnector', ['createConnection', 'getOptions'] ); + $connector = $this->getMock('Illuminate\Database\Connectors\PostgresConnector', ['createConnection', 'getOptions']); $connection = m::mock('stdClass'); $connector->expects($this->once())->method('getOptions')->with($this->equalTo($config))->will($this->returnValue(['options'])); $connector->expects($this->once())->method('createConnection')->with($this->equalTo($dsn), $this->equalTo($config), $this->equalTo(['options']))->will($this->returnValue($connection)); diff --git a/tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php b/tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php index bb1f002ac5..e45305a94a 100644 --- a/tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php +++ b/tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php @@ -124,7 +124,6 @@ class DatabaseEloquentSoftDeletesIntegrationTest extends PHPUnit_Framework_TestC $this->assertEquals(1, $users->first()->id); } - /** * Helpers... */ @@ -169,7 +168,6 @@ class SoftDeletesTestUser extends Eloquent protected $guarded = []; } - /** * Connection Resolver. */ diff --git a/tests/Database/DatabaseMigrationMakeCommandTest.php b/tests/Database/DatabaseMigrationMakeCommandTest.php index 757c9de84d..3f3b79bdf8 100755 --- a/tests/Database/DatabaseMigrationMakeCommandTest.php +++ b/tests/Database/DatabaseMigrationMakeCommandTest.php @@ -58,7 +58,7 @@ class DatabaseMigrationMakeCommandTest extends PHPUnit_Framework_TestCase public function testCanSpecifyPathToCreateMigrationsIn() { - $command = new MigrateMakeCommand( + $command = new MigrateMakeCommand( $creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'), m::mock('Illuminate\Foundation\Composer')->shouldIgnoreMissing(), __DIR__.'/vendor' diff --git a/tests/Database/DatabaseMySqlSchemaGrammarTest.php b/tests/Database/DatabaseMySqlSchemaGrammarTest.php index a77b167326..088f764871 100755 --- a/tests/Database/DatabaseMySqlSchemaGrammarTest.php +++ b/tests/Database/DatabaseMySqlSchemaGrammarTest.php @@ -581,7 +581,7 @@ class DatabaseMySqlSchemaGrammarTest extends PHPUnit_Framework_TestCase public function testAddingTimeStampTzWithDefault() { $blueprint = new Blueprint('users'); - $blueprint->timestampTz('foo')->default('2015-07-22 11:43:17');; + $blueprint->timestampTz('foo')->default('2015-07-22 11:43:17'); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 307e0c3128..dd671e2f62 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -538,7 +538,7 @@ class DatabaseQueryBuilderTest extends PHPUnit_Framework_TestCase public function testGetCountForPaginationWithBindings() { $builder = $this->getBuilder(); - $builder->from('users')->selectSub(function($q) { $q->select('body')->from('posts')->where('id', 4); }, 'post'); + $builder->from('users')->selectSub(function ($q) { $q->select('body')->from('posts')->where('id', 4); }, 'post'); $builder->getConnection()->shouldReceive('select')->once()->with('select count(*) as aggregate from "users"', [], true)->andReturn([['aggregate' => 1]]); $builder->getProcessor()->shouldReceive('processSelect')->once()->andReturnUsing(function ($builder, $results) { return $results; }); @@ -854,7 +854,7 @@ class DatabaseQueryBuilderTest extends PHPUnit_Framework_TestCase $builder = $this->getBuilder(); $builder->getConnection()->shouldReceive('select')->once()->with('select count(*) as aggregate from "users"', [], true)->andReturn([['aggregate' => 1]]); $builder->getProcessor()->shouldReceive('processSelect')->once()->andReturnUsing(function ($builder, $results) { return $results; }); - $builder->from('users')->selectSub(function($query) { $query->from('posts')->select('foo')->where('title', 'foo'); }, 'post'); + $builder->from('users')->selectSub(function ($query) { $query->from('posts')->select('foo')->where('title', 'foo'); }, 'post'); $count = $builder->count(); $this->assertEquals(1, $count); $this->assertEquals(['foo'], $builder->getBindings()); diff --git a/tests/Http/HttpRequestTest.php b/tests/Http/HttpRequestTest.php index cd7058a5cb..052dc0014b 100755 --- a/tests/Http/HttpRequestTest.php +++ b/tests/Http/HttpRequestTest.php @@ -343,7 +343,7 @@ class HttpRequestTest extends PHPUnit_Framework_TestCase $this->assertEquals('text/html', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => 'application/json;q=0.4, text/html;q=0.6'])->prefers(['text/html', 'application/json'])); $this->assertEquals('text/html', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => 'application/json;q=0.4, text/html;q=0.6'])->prefers(['application/json', 'text/html'])); - $this->assertEquals('json', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => '*/*; charset=utf-8'])->prefers('json')); + $this->assertEquals('json', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => '*/*; charset=utf-8'])->prefers('json')); $this->assertEquals('application/json', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => 'application/*'])->prefers('application/json')); $this->assertEquals('application/xml', Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => 'application/*'])->prefers('application/xml')); $this->assertNull(Request::create('/', 'GET', [], [], [], ['HTTP_ACCEPT' => 'application/*'])->prefers('text/html')); diff --git a/tests/Queue/QueueDatabaseQueueTest.php b/tests/Queue/QueueDatabaseQueueTest.php index a43393ea3d..71f70add49 100644 --- a/tests/Queue/QueueDatabaseQueueTest.php +++ b/tests/Queue/QueueDatabaseQueueTest.php @@ -20,7 +20,7 @@ class QueueDatabaseQueueTest extends PHPUnit_Framework_TestCase $this->assertEquals(0, $array['attempts']); $this->assertEquals(0, $array['reserved']); $this->assertNull($array['reserved_at']); - $this->assertTrue(is_integer($array['available_at'])); + $this->assertTrue(is_int($array['available_at'])); }); $queue->push('foo', ['data']); @@ -41,7 +41,7 @@ class QueueDatabaseQueueTest extends PHPUnit_Framework_TestCase $this->assertEquals(0, $array['attempts']); $this->assertEquals(0, $array['reserved']); $this->assertNull($array['reserved_at']); - $this->assertTrue(is_integer($array['available_at'])); + $this->assertTrue(is_int($array['available_at'])); }); $queue->later(10, 'foo', ['data']); diff --git a/tests/Routing/RoutingRouteTest.php b/tests/Routing/RoutingRouteTest.php index 03e5bc39d1..8528db94d4 100644 --- a/tests/Routing/RoutingRouteTest.php +++ b/tests/Routing/RoutingRouteTest.php @@ -669,31 +669,31 @@ return 'foo!'; }); public function testRoutePrefixing() { - /** + /* * Prefix route */ $router = $this->getRouter(); - $router->get('foo/bar', function() { return 'hello'; }); + $router->get('foo/bar', function () { return 'hello'; }); $routes = $router->getRoutes(); $routes = $routes->getRoutes(); $routes[0]->prefix('prefix'); $this->assertEquals('prefix/foo/bar', $routes[0]->uri()); - /** + /* * Use empty prefix */ $router = $this->getRouter(); - $router->get('foo/bar', function() { return 'hello'; }); + $router->get('foo/bar', function () { return 'hello'; }); $routes = $router->getRoutes(); $routes = $routes->getRoutes(); $routes[0]->prefix('/'); $this->assertEquals('foo/bar', $routes[0]->uri()); - /** + /* * Prefix homepage */ $router = $this->getRouter(); - $router->get('/', function() { return 'hello'; }); + $router->get('/', function () { return 'hello'; }); $routes = $router->getRoutes(); $routes = $routes->getRoutes(); $routes[0]->prefix('prefix'); diff --git a/tests/Support/SupportArrTest.php b/tests/Support/SupportArrTest.php index afd5f64641..9d4f243a1a 100644 --- a/tests/Support/SupportArrTest.php +++ b/tests/Support/SupportArrTest.php @@ -13,7 +13,6 @@ class SupportArrTest extends PHPUnit_Framework_TestCase $this->assertFalse(Arr::isAssoc(['a', 'b'])); } - public function testSortRecursive() { $array = [ diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index e55ddfd350..273e9436ea 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -694,7 +694,7 @@ class SupportCollectionTest extends PHPUnit_Framework_TestCase $this->assertEquals(1, $c->search(2)); $this->assertEquals('foo', $c->search('bar')); $this->assertEquals(4, $c->search(function ($value) { return $value > 4; })); - $this->assertEquals('foo', $c->search(function ($value) { return !is_numeric($value); })); + $this->assertEquals('foo', $c->search(function ($value) { return ! is_numeric($value); })); } public function testSearchReturnsFalseWhenItemIsNotFound() @@ -804,7 +804,7 @@ class TestAccessorEloquentTestStub $accessor = 'get'.lcfirst($attribute).'Attribute'; if (method_exists($this, $accessor)) { - return !is_null($this->$accessor()); + return ! is_null($this->$accessor()); } return isset($this->$attribute); diff --git a/tests/Support/SupportHelpersTest.php b/tests/Support/SupportHelpersTest.php index c497e7cc22..f211b86c9e 100755 --- a/tests/Support/SupportHelpersTest.php +++ b/tests/Support/SupportHelpersTest.php @@ -351,7 +351,7 @@ class SupportHelpersTest extends PHPUnit_Framework_TestCase 'bar', 'baz', 'foo', - ] + ], ]; $this->assertEquals($assumedArray, array_sort_recursive($array));