language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | laravel | framework | 9ad2666abfc64e81dc3b4e7cdc5e24ab0c6cdab1.json | Allow connection in 'exists' validation (test)
Test case for the ability to use a connection in the 'exists' validation rule. | tests/Validation/ValidationValidatorTest.php | @@ -902,6 +902,13 @@ public function testValidationExists()
$mock3->shouldReceive('getMultiCount')->once()->with('users', 'email_addr', ['foo'], [])->andReturn(false);
$v->setPresenceVerifier($mock3);
$this->assertFalse($v->passes());
+
+ $v = new Validator($trans, ['email' => 'foo'], ['email' => 'Exists:connection.users']);
+ $mock5 = m::mock('Illuminate\Validation\PresenceVerifierInterface');
+ $mock5->shouldReceive('setConnection')->once()->with('connection');
+ $mock5->shouldReceive('getCount')->once()->with('users', 'email', 'foo', null, null, [])->andReturn(true);
+ $v->setPresenceVerifier($mock5);
+ $this->assertTrue($v->passes());
}
public function testValidationExistsIsNotCalledUnnecessarily() | false |
Other | laravel | framework | 94f11c1d741d921e25c6fb6cbb8373f7d97ad161.json | Allow connection in 'exists' validation
The 'unique' validation rule allows a connection to be specified in the table name (using dot notation). This change simply duplicates it on the 'exists' validation rule in a fully backwards compatible way. | src/Illuminate/Validation/Validator.php | @@ -998,7 +998,7 @@ protected function validateUnique($attribute, $value, $parameters)
{
$this->requireParameterCount(1, $parameters, 'unique');
- list($connection, $table) = $this->parseUniqueTable($parameters[0]);
+ list($connection, $table) = $this->parseTable($parameters[0]);
// The second parameter position holds the name of the column that needs to
// be verified as unique. If this parameter isn't specified we will just
@@ -1034,12 +1034,12 @@ protected function validateUnique($attribute, $value, $parameters)
}
/**
- * Parse the connection / table for the unique rule.
+ * Parse the connection / table for the unique / exists rules.
*
* @param string $table
* @return array
*/
- protected function parseUniqueTable($table)
+ protected function parseTable($table)
{
return Str::contains($table, '.') ? explode('.', $table, 2) : [null, $table];
}
@@ -1084,7 +1084,7 @@ protected function validateExists($attribute, $value, $parameters)
{
$this->requireParameterCount(1, $parameters, 'exists');
- $table = $parameters[0];
+ list($connection, $table) = $this->parseTable($parameters[0]);
// The second parameter position holds the name of the column that should be
// verified as existing. If this parameter is not specified we will guess
@@ -1093,22 +1093,27 @@ protected function validateExists($attribute, $value, $parameters)
$expected = (is_array($value)) ? count($value) : 1;
- return $this->getExistCount($table, $column, $value, $parameters) >= $expected;
+ return $this->getExistCount($connection, $table, $column, $value, $parameters) >= $expected;
}
/**
* Get the number of records that exist in storage.
*
+ * @param mixed $connection
* @param string $table
* @param string $column
* @param mixed $value
* @param array $parameters
* @return int
*/
- protected function getExistCount($table, $column, $value, $parameters)
+ protected function getExistCount($connection, $table, $column, $value, $parameters)
{
$verifier = $this->getPresenceVerifier();
+ if (! is_null($connection)) {
+ $verifier->setConnection($connection);
+ }
+
$extra = $this->getExtraExistConditions($parameters);
if (is_array($value)) { | false |
Other | laravel | framework | 767558e7841b4fa37d67db9e6cb3e3ba19db77f7.json | Add negative numbers test | tests/Support/SupportCollectionTest.php | @@ -302,6 +302,9 @@ public function testSort()
$data = (new Collection([5, 3, 1, 2, 4]))->sort();
$this->assertEquals([1, 2, 3, 4, 5], $data->values()->all());
+ $data = (new Collection([-1, -3, -2, -4, -5, 0, 5, 3, 1, 2, 4]))->sort();
+ $this->assertEquals([-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], $data->values()->all());
+
$data = (new Collection(['foo', 'bar-10', 'bar-1']))->sort();
$this->assertEquals(['bar-1', 'bar-10', 'foo'], $data->values()->all());
} | false |
Other | laravel | framework | 16c0e3e6c176055bef248eb88b385c881fb13ed6.json | fix some formatting issues. | src/Illuminate/Console/Command.php | @@ -10,8 +10,8 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
-use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Illuminate\Contracts\Foundation\Application as LaravelApplication;
class Command extends SymfonyCommand
@@ -384,7 +384,9 @@ public function error($string)
public function warn($string)
{
$style = new OutputFormatterStyle('yellow');
+
$this->output->getFormatter()->setStyle('warning', $style);
+
$this->output->writeln("<warning>$string</warning>");
}
| false |
Other | laravel | framework | e6dbdfbe35d299447c1a1d01359e568a282c1503.json | remove double check of hidden relations | src/Illuminate/Database/Eloquent/Model.php | @@ -2498,12 +2498,7 @@ public function relationsToArray()
{
$attributes = [];
- $hidden = $this->getHidden();
-
foreach ($this->getArrayableRelations() as $key => $value) {
- if (in_array($key, $hidden)) {
- continue;
- }
// If the values implements the Arrayable interface we can just call this
// toArray method on the instances which will convert both models and | false |
Other | laravel | framework | 496406ce209bb5b9ef99658ce3a62f6f4415b559.json | fix method order. | src/Illuminate/Mail/Mailer.php | @@ -231,7 +231,7 @@ public function onQueue($queue, $view, array $data, $callback)
*/
public function queueOn($queue, $view, array $data, $callback)
{
- return $this->onQueue($view, $data, $callback, $queue);
+ return $this->onQueue($queue, $view, $data, $callback);
}
/** | false |
Other | laravel | framework | ed24e391a965d0eb2a73daeb625bb235257e6745.json | add method for consistency | src/Illuminate/Mail/Mailer.php | @@ -213,11 +213,27 @@ public function queue($view, array $data, $callback, $queue = null)
* @param \Closure|string $callback
* @return mixed
*/
- public function queueOn($queue, $view, array $data, $callback)
+ public function onQueue($queue, $view, array $data, $callback)
{
return $this->queue($view, $data, $callback, $queue);
}
+ /**
+ * Queue a new e-mail message for sending on the given queue.
+ *
+ * This method didn't match rest of framework's "onQueue" phrasing. Added "onQueue".
+ *
+ * @param string $queue
+ * @param string|array $view
+ * @param array $data
+ * @param \Closure|string $callback
+ * @return mixed
+ */
+ public function queueOn($queue, $view, array $data, $callback)
+ {
+ return $this->onQueue($view, $data, $callback, $queue);
+ }
+
/**
* Queue a new e-mail message for sending after (n) seconds.
* | false |
Other | laravel | framework | b44def9a5ae4385333f9ef848461f740ffad0aee.json | Add uncheck method
This method would add a convenient way to uncheck a checkbox. The api would also be more consistent as there is already a check method. | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -552,6 +552,17 @@ protected function check($element)
{
return $this->storeInput($element, true);
}
+
+ /**
+ * Uncheck a checkbox on the page.
+ *
+ * @param string $element
+ * @return $this
+ */
+ protected function uncheck($element)
+ {
+ return $this->storeInput($element, false);
+ }
/**
* Select an option from a drop-down. | false |
Other | laravel | framework | 1febc31fb8baae178f84757cd58c5d2597afc98d.json | Add missing *orFail methods in relationships | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -610,6 +610,30 @@ public function findMany($ids, $columns = ['*'])
return $this->get($columns);
}
+ /**
+ * Find a related model by its primary key or throw an exception.
+ *
+ * @param mixed $id
+ * @param array $columns
+ * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
+ *
+ * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
+ */
+ public function findOrFail($id, $columns = ['*'])
+ {
+ $result = $this->find($id, $columns);
+
+ if (is_array($id)) {
+ if (count($result) == count(array_unique($id))) {
+ return $result;
+ }
+ } elseif (! is_null($result)) {
+ return $result;
+ }
+
+ throw (new ModelNotFoundException)->setModel(get_class($this->parent));
+ }
+
/**
* Find a related model by its primary key or return new instance of the related model.
* | true |
Other | laravel | framework | 1febc31fb8baae178f84757cd58c5d2597afc98d.json | Add missing *orFail methods in relationships | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | @@ -6,6 +6,7 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
class HasManyThrough extends Relation
{
@@ -227,6 +228,23 @@ public function first($columns = ['*'])
return count($results) > 0 ? $results->first() : null;
}
+ /**
+ * Execute the query and get the first result or throw an exception.
+ *
+ * @param array $columns
+ * @return \Illuminate\Database\Eloquent\Model|static
+ *
+ * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
+ */
+ public function firstOrFail($columns = ['*'])
+ {
+ if (! is_null($model = $this->first($columns))) {
+ return $model;
+ }
+
+ throw new ModelNotFoundException;
+ }
+
/**
* Find a related model by its primary key.
*
@@ -263,6 +281,30 @@ public function findMany($ids, $columns = ['*'])
return $this->get($columns);
}
+ /**
+ * Find a related model by its primary key or throw an exception.
+ *
+ * @param mixed $id
+ * @param array $columns
+ * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
+ *
+ * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
+ */
+ public function findOrFail($id, $columns = ['*'])
+ {
+ $result = $this->find($id, $columns);
+
+ if (is_array($id)) {
+ if (count($result) == count(array_unique($id))) {
+ return $result;
+ }
+ } elseif (! is_null($result)) {
+ return $result;
+ }
+
+ throw (new ModelNotFoundException)->setModel(get_class($this->parent));
+ }
+
/**
* Execute the query as a "select" statement.
* | true |
Other | laravel | framework | ed4ccf6b3932d3a0cadce79379d71104bc4c4c2b.json | add handle method from lumen into crawler trait. | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -142,6 +142,21 @@ public function delete($uri, array $data = [], array $headers = [])
return $this;
}
+ /**
+ * Send the given request through the application.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return $this
+ */
+ public function handle(Request $request)
+ {
+ $this->currentUri = $request->fullUrl();
+
+ $this->response = $this->app->prepareResponse($this->app->handle($request));
+
+ return $this;
+ }
+
/**
* Make a request to the application and create a Crawler instance.
* | false |
Other | laravel | framework | 41af46bd21065da7ca97539b400617a3961f3d77.json | Display column listing when using FETCH_ASSOC
MSSQL Column listing doesn't display when using FETCH_ASSOC. | src/Illuminate/Database/Query/Processors/SqlServerProcessor.php | @@ -33,6 +33,7 @@ public function processInsertGetId(Builder $query, $sql, $values, $sequence = nu
public function processColumnListing($results)
{
$mapping = function ($r) {
+ $r = (object) $r;
return $r->name;
};
| false |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | .php_cs | @@ -1,31 +1,43 @@
<?php
-$finder = Symfony\Component\Finder\Finder::create()
- ->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__)); | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | .styleci.yml | @@ -0,0 +1 @@
+preset: laravel | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/AuthManager.php | @@ -29,9 +29,9 @@ protected function createDriver($driver)
}
if (method_exists($guard, 'setRequest')) {
- $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));
+ $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));
}
-
+
return $guard;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/DatabaseUserProvider.php | @@ -104,7 +104,7 @@ public function retrieveByCredentials(array $credentials)
$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);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/EloquentUserProvider.php | @@ -92,7 +92,7 @@ public function retrieveByCredentials(array $credentials)
$query = $this->createModel()->newQuery();
foreach ($credentials as $key => $value) {
- if (!Str::contains($key, 'password')) {
+ if (! Str::contains($key, 'password')) {
$query->where($key, $value);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/Guard.php | @@ -109,7 +109,7 @@ public function __construct(UserProvider $provider,
*/
public function check()
{
- return !is_null($this->user());
+ return ! is_null($this->user());
}
/**
@@ -119,7 +119,7 @@ public function check()
*/
public function guest()
{
- return !$this->check();
+ return ! $this->check();
}
/**
@@ -136,7 +136,7 @@ public function user()
// 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 @@ public function user()
// 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 @@ public function user()
// 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 @@ public function id()
*/
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 @@ protected function getRecallerId()
*/
protected function validRecaller($recaller)
{
- if (!is_string($recaller) || !Str::contains($recaller, '|')) {
+ if (! is_string($recaller) || ! Str::contains($recaller, '|')) {
return false;
}
@@ -305,7 +305,7 @@ public function basic($field = 'email')
*/
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 @@ public function onceBasic($field = 'email')
*/
protected function attemptBasic(Request $request, $field)
{
- if (!$request->getUser()) {
+ if (! $request->getUser()) {
return false;
}
@@ -387,7 +387,7 @@ public function attempt(array $credentials = [], $remember = false, $login = tru
*/
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 @@ public function loginUsingId($id, $remember = false)
*/
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 @@ public function logout()
// 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 @@ protected function createRememberTokenIfDoesntExist(UserContract $user)
*/
public function getCookieJar()
{
- if (!isset($this->cookie)) {
+ if (! isset($this->cookie)) {
throw new RuntimeException('Cookie jar has not been set.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php | @@ -112,7 +112,7 @@ public function exists(CanResetPasswordContract $user, $token)
$token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();
- return $token && !$this->tokenExpired($token);
+ return $token && ! $this->tokenExpired($token);
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Auth/Passwords/PasswordBroker.php | @@ -112,7 +112,7 @@ public function emailResetLink(CanResetPasswordContract $user, $token, Closure $
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 @@ public function reset(array $credentials, Closure $callback)
// 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 @@ protected function validateReset(array $credentials)
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 @@ public function getUser(array $credentials)
$user = $this->users->retrieveByCredentials($credentials);
- if ($user && !$user instanceof CanResetPasswordContract) {
+ if ($user && ! $user instanceof CanResetPasswordContract) {
throw new UnexpectedValueException('User must implement CanResetPassword interface.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Bus/Dispatcher.php | @@ -235,7 +235,7 @@ public function dispatchToQueue($command)
{
$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.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/DatabaseStore.php | @@ -70,7 +70,7 @@ public function get($key)
// 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 @@ protected function incrementOrDecrement($key, $value, Closure $callback)
$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)) { | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/MemcachedConnector.php | @@ -30,7 +30,7 @@ public function connect(array $servers)
$memcachedStatus = $memcached->getVersion();
- if (!is_array($memcachedStatus)) {
+ if (! is_array($memcachedStatus)) {
throw new RuntimeException('No Memcached servers added.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/RateLimiter.php | @@ -6,86 +6,86 @@
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();
+ }
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/RedisStore.php | @@ -51,7 +51,7 @@ public function __construct(Redis $redis, $prefix = '', $connection = 'default')
*/
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);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/Repository.php | @@ -82,7 +82,7 @@ protected function fireCacheEvent($event, $payload)
*/
public function has($key)
{
- return !is_null($this->get($key));
+ return ! is_null($this->get($key));
}
/**
@@ -135,7 +135,7 @@ public function put($key, $value, $minutes)
{
$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 @@ public function remember($key, $minutes, Closure $callback)
// 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 @@ public function rememberForever($key, Closure $callback)
// 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;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cache/TaggedCache.php | @@ -44,7 +44,7 @@ public function __construct(Store $store, TagSet $tags)
*/
public function has($key)
{
- return !is_null($this->get($key));
+ return ! is_null($this->get($key));
}
/**
@@ -58,7 +58,7 @@ public function get($key, $default = null)
{
$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 @@ public function put($key, $value, $minutes)
{
$minutes = $this->getMinutes($minutes);
- if (!is_null($minutes)) {
+ if (! is_null($minutes)) {
$this->store->put($this->taggedItemKey($key), $value, $minutes);
}
}
@@ -167,7 +167,7 @@ public function remember($key, $minutes, Closure $callback)
// 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 @@ public function rememberForever($key, Closure $callback)
// 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;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/Command.php | @@ -75,7 +75,7 @@ public function __construct()
$this->setDescription($this->description);
- if (!isset($this->signature)) {
+ if (! isset($this->signature)) {
$this->specifyParameters();
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/ConfirmableTrait.php | @@ -29,7 +29,7 @@ public function confirmToProceed($warning = 'Application In Production!', Closur
$confirmed = $this->confirm('Do you really wish to run this command? [y/N]');
- if (!$confirmed) {
+ if (! $confirmed) {
$this->comment('Command Cancelled!');
return false; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/GeneratorCommand.php | @@ -132,7 +132,7 @@ protected function getDefaultNamespace($rootNamespace)
*/
protected function makeDirectory($path)
{
- if (!$this->files->isDirectory(dirname($path))) {
+ if (! $this->files->isDirectory(dirname($path))) {
$this->files->makeDirectory(dirname($path), 0777, true, true);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/Parser.php | @@ -53,7 +53,7 @@ protected static function parameters(array $tokens)
$options = [];
foreach ($tokens as $token) {
- if (!Str::startsWith($token, '--')) {
+ if (! Str::startsWith($token, '--')) {
$arguments[] = static::parseArgument($token);
} else {
$options[] = static::parseOption(ltrim($token, '-')); | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/Scheduling/CallbackEvent.php | @@ -34,7 +34,7 @@ public function __construct($callback, array $parameters = [])
$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 @@ protected function removeMutex()
*/
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'."
); | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Console/Scheduling/Event.php | @@ -231,7 +231,7 @@ protected function mutexPath()
*/
public function isDue(Application $app)
{
- if (!$this->runsInMaintenanceMode() && $app->isDownForMaintenance()) {
+ if (! $this->runsInMaintenanceMode() && $app->isDownForMaintenance()) {
return false;
}
@@ -264,7 +264,7 @@ protected function expressionPasses()
*/
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;
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Container/Container.php | @@ -187,7 +187,7 @@ public function bind($abstract, $concrete = null, $shared = false)
// 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 @@ public function addContextualBinding($concrete, $abstract, $implementation)
*/
public function bindIf($abstract, $concrete = null, $shared = false)
{
- if (!$this->bound($abstract)) {
+ if (! $this->bound($abstract)) {
$this->bind($abstract, $concrete, $shared);
}
}
@@ -342,7 +342,7 @@ public function tag($abstracts, $tags)
$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] = [];
}
@@ -496,7 +496,7 @@ public function call($callback, array $parameters = [], $defaultMethod = null)
*/
protected function isCallableWithAtSign($callback)
{
- if (!is_string($callback)) {
+ if (! is_string($callback)) {
return false;
}
@@ -643,14 +643,14 @@ public function make($abstract, array $parameters = [])
*/
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;
@@ -724,7 +724,7 @@ public function build($concrete, array $parameters = [])
// 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 BindingResolutionException($message);
@@ -937,7 +937,7 @@ protected function getFunctionHint(Closure $callback)
$expected = $function->getParameters()[0];
- if (!$expected->getClass()) {
+ if (! $expected->getClass()) {
return;
}
@@ -1155,7 +1155,7 @@ public function offsetSet($key, $value)
// 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;
}; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Contracts/Support/Htmlable.php | @@ -5,7 +5,7 @@
interface Htmlable
{
/**
- * Get content as a string of HTML
+ * Get content as a string of HTML.
*
* @return string
*/ | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Cookie/CookieJar.php | @@ -87,7 +87,7 @@ public function forget($name, $path = null, $domain = null)
*/
public function hasQueued($key)
{
- return !is_null($this->queued($key));
+ return ! is_null($this->queued($key));
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Connection.php | @@ -733,7 +733,7 @@ public function logQuery($query, $bindings, $time = null)
$this->events->fire('illuminate.query', [$query, $bindings, $time, $this->getName()]);
}
- if (!$this->loggingQueries) {
+ if (! $this->loggingQueries) {
return;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Connectors/ConnectionFactory.php | @@ -164,7 +164,7 @@ protected function parseConfig(array $config, $name)
*/
public function createConnector(array $config)
{
- if (!isset($config['driver'])) {
+ if (! isset($config['driver'])) {
throw new InvalidArgumentException('A driver must be specified.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Connectors/MySqlConnector.php | @@ -33,7 +33,7 @@ public function connect(array $config)
$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 @@ protected function getDsn(array $config)
*/
protected function configHasSocket(array $config)
{
- return isset($config['unix_socket']) && !empty($config['unix_socket']);
+ return isset($config['unix_socket']) && ! empty($config['unix_socket']);
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Migrations/MigrateCommand.php | @@ -51,7 +51,7 @@ public function __construct(Migrator $migrator)
*/
public function fire()
{
- if (!$this->confirmToProceed()) {
+ if (! $this->confirmToProceed()) {
return;
}
@@ -65,7 +65,7 @@ public function fire()
// 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 @@ protected function prepareDatabase()
{
$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); | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php | @@ -69,7 +69,7 @@ public function fire()
$create = $this->input->getOption('create');
- if (!$table && is_string($create)) {
+ if (! $table && is_string($create)) {
$table = $create;
}
@@ -105,7 +105,7 @@ protected function writeMigration($name, $table, $create)
*/
protected function getMigrationPath()
{
- if (!is_null($targetPath = $this->input->getOption('path'))) {
+ if (! is_null($targetPath = $this->input->getOption('path'))) {
return $this->laravel->basePath().'/'.$targetPath;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | 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;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Migrations/ResetCommand.php | @@ -52,13 +52,13 @@ public function __construct(Migrator $migrator)
*/
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('<comment>Migration table not found.</comment>');
return; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Migrations/RollbackCommand.php | @@ -52,7 +52,7 @@ public function __construct(Migrator $migrator)
*/
public function fire()
{
- if (!$this->confirmToProceed()) {
+ if (! $this->confirmToProceed()) {
return;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Migrations/StatusCommand.php | @@ -47,7 +47,7 @@ public function __construct(Migrator $migrator)
*/
public function fire()
{
- if (!$this->migrator->repositoryExists()) {
+ if (! $this->migrator->repositoryExists()) {
return $this->error('No migrations found.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Console/Seeds/SeedCommand.php | @@ -52,7 +52,7 @@ public function __construct(Resolver $resolver)
*/
public function fire()
{
- if (!$this->confirmToProceed()) {
+ if (! $this->confirmToProceed()) {
return;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/DatabaseManager.php | @@ -63,7 +63,7 @@ public function connection($name = null)
// 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 @@ public function reconnect($name = null)
{
$this->disconnect($name = $name ?: $this->getDefaultConnection());
- if (!isset($this->connections[$name])) {
+ if (! isset($this->connections[$name])) {
return $this->connection($name);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Builder.php | @@ -122,7 +122,7 @@ public function findOrFail($id, $columns = ['*'])
if (count($result) == count(array_unique($id))) {
return $result;
}
- } elseif (!is_null($result)) {
+ } elseif (! is_null($result)) {
return $result;
}
@@ -150,7 +150,7 @@ public function first($columns = ['*'])
*/
public function firstOrFail($columns = ['*'])
{
- if (!is_null($model = $this->first($columns))) {
+ if (! is_null($model = $this->first($columns))) {
return $model;
}
@@ -336,7 +336,7 @@ public function decrement($column, $amount = 1, array $extra = [])
*/
protected function addUpdatedAtColumn(array $values)
{
- if (!$this->model->usesTimestamps()) {
+ if (! $this->model->usesTimestamps()) {
return $values;
}
@@ -789,7 +789,7 @@ protected function parseNested($name, $results)
foreach (explode('.', $name) as $segment) {
$progress[] = $segment;
- if (!isset($results[$last = implode('.', $progress)])) {
+ if (! isset($results[$last = implode('.', $progress)])) {
$results[$last] = function () {};
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Collection.php | @@ -124,7 +124,7 @@ public function diff($items)
$dictionary = $this->getDictionary($items);
foreach ($this->items as $item) {
- if (!isset($dictionary[$item->getKey()])) {
+ if (! isset($dictionary[$item->getKey()])) {
$diff->add($item);
}
}
@@ -161,7 +161,7 @@ public function intersect($items)
*/
public function unique($key = null)
{
- if (!is_null($key)) {
+ if (! is_null($key)) {
return parent::unique($key);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/FactoryBuilder.php | @@ -123,7 +123,7 @@ public function make(array $attributes = [])
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}].");
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Model.php | @@ -287,7 +287,7 @@ protected function bootIfNotBooted()
{
$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 @@ public static function addGlobalScope(ScopeInterface $scope)
*/
public static function hasGlobalScope($scope)
{
- return !is_null(static::getGlobalScope($scope));
+ return ! is_null(static::getGlobalScope($scope));
}
/**
@@ -454,7 +454,7 @@ public function forceFill(array $attributes)
*/
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 @@ public static function forceCreate(array $attributes)
*/
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 @@ public static function firstOrCreate(array $attributes)
*/
public static function firstOrNew(array $attributes)
{
- if (!is_null($instance = static::where($attributes)->first())) {
+ if (! is_null($instance = static::where($attributes)->first())) {
return $instance;
}
@@ -677,7 +677,7 @@ public static function all($columns = ['*'])
*/
public static function findOrNew($id, $columns = ['*'])
{
- if (!is_null($model = static::find($id, $columns))) {
+ if (! is_null($model = static::find($id, $columns))) {
return $model;
}
@@ -692,7 +692,7 @@ public static function findOrNew($id, $columns = ['*'])
*/
public function fresh(array $with = [])
{
- if (!$this->exists) {
+ if (! $this->exists) {
return;
}
@@ -1061,10 +1061,10 @@ protected function getBelongsToManyCaller()
$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;
}
/**
@@ -1283,7 +1283,7 @@ public static function deleted($callback, $priority = 0)
*/
public static function flushEventListeners()
{
- if (!isset(static::$dispatcher)) {
+ if (! isset(static::$dispatcher)) {
return;
}
@@ -1401,7 +1401,7 @@ protected function incrementOrDecrement($column, $amount, $method)
{
$query = $this->newQuery();
- if (!$this->exists) {
+ if (! $this->exists) {
return $query->{$method}($column, $amount);
}
@@ -1434,7 +1434,7 @@ protected function incrementOrDecrementAttributeValue($column, $amount, $method)
*/
public function update(array $attributes = [], array $options = [])
{
- if (!$this->exists) {
+ if (! $this->exists) {
return $this->newQuery()->update($attributes);
}
@@ -1448,7 +1448,7 @@ public function update(array $attributes = [], array $options = [])
*/
public function push()
{
- if (!$this->save()) {
+ if (! $this->save()) {
return false;
}
@@ -1460,7 +1460,7 @@ public function push()
? $models->all() : [$models];
foreach (array_filter($models) as $model) {
- if (!$model->push()) {
+ if (! $model->push()) {
return false;
}
}
@@ -1667,7 +1667,7 @@ public function touches($relation)
*/
protected function fireModelEvent($event, $halt = true)
{
- if (!isset(static::$dispatcher)) {
+ if (! isset(static::$dispatcher)) {
return true;
}
@@ -1715,7 +1715,7 @@ protected function getKeyForSaveQuery()
*/
public function touch()
{
- if (!$this->timestamps) {
+ if (! $this->timestamps) {
return false;
}
@@ -1733,11 +1733,11 @@ protected function updateTimestamps()
{
$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);
}
}
@@ -2290,7 +2290,7 @@ public function isFillable($key)
return false;
}
- return empty($this->fillable) && !Str::startsWith($key, '_');
+ return empty($this->fillable) && ! Str::startsWith($key, '_');
}
/**
@@ -2322,7 +2322,7 @@ public function totallyGuarded()
*/
protected function removeTableFromKey($key)
{
- if (!Str::contains($key, '.')) {
+ if (! Str::contains($key, '.')) {
return $key;
}
@@ -2417,7 +2417,7 @@ public function attributesToArray()
// 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;
}
@@ -2432,7 +2432,7 @@ public function attributesToArray()
// 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;
}
@@ -2445,7 +2445,7 @@ public function attributesToArray()
// 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;
}
@@ -2482,7 +2482,7 @@ protected function getArrayableAttributes()
*/
protected function getArrayableAppends()
{
- if (!count($this->appends)) {
+ if (! count($this->appends)) {
return [];
}
@@ -2609,7 +2609,7 @@ public function getAttributeValue($key)
// 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);
}
}
@@ -2665,7 +2665,7 @@ protected function getRelationshipFromMethod($method)
{
$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');
}
@@ -3031,7 +3031,7 @@ public function isDirty($attributes = null)
return count($dirty) > 0;
}
- if (!is_array($attributes)) {
+ if (! is_array($attributes)) {
$attributes = func_get_args();
}
@@ -3054,10 +3054,10 @@ public function getDirty()
$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;
}
}
@@ -3254,7 +3254,7 @@ public function getMutatedAttributes()
{
$class = get_class($this);
- if (!isset(static::$mutatorCache[$class])) {
+ if (! isset(static::$mutatorCache[$class])) {
static::cacheMutatedAttributes($class);
}
@@ -3365,7 +3365,7 @@ public function offsetUnset($offset)
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)));
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Relations/BelongsTo.php | @@ -154,7 +154,7 @@ protected function getEagerModelKeys(array $models)
// 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;
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -151,7 +151,7 @@ public function first($columns = ['*'])
*/
public function firstOrFail($columns = ['*'])
{
- if (!is_null($model = $this->first($columns))) {
+ if (! is_null($model = $this->first($columns))) {
return $model;
}
@@ -782,7 +782,7 @@ protected function formatSyncList(array $records)
$results = [];
foreach ($records as $id => $attributes) {
- if (!is_array($attributes)) {
+ if (! is_array($attributes)) {
list($id, $attributes) = [$attributes, []];
}
@@ -808,7 +808,7 @@ protected function attachNew(array $records, array $current, $touch = true)
// 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 @@ protected function setTimestampsOnAttach(array $record, $exists = false)
{
$fresh = $this->parent->freshTimestamp();
- if (!$exists && $this->hasPivotColumn($this->createdAt())) {
+ if (! $exists && $this->hasPivotColumn($this->createdAt())) {
$record[$this->createdAt()] = $fresh;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/Relations/MorphTo.php | @@ -61,7 +61,7 @@ public function __construct(Builder $query, Model $parent, $foreignKey, $otherKe
*/
public function getResults()
{
- if (!$this->otherKey) {
+ if (! $this->otherKey) {
return;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Eloquent/SoftDeletes.php | @@ -98,7 +98,7 @@ public function restore()
*/
public function trashed()
{
- return !is_null($this->{$this->getDeletedAtColumn()});
+ return ! is_null($this->{$this->getDeletedAtColumn()});
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Migrations/MigrationCreator.php | @@ -96,7 +96,7 @@ protected function populateStub($name, $stub, $table)
// 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);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Migrations/Migrator.php | @@ -364,7 +364,7 @@ public function resolveConnection($connection)
*/
public function setConnection($name)
{
- if (!is_null($name)) {
+ if (! is_null($name)) {
$this->resolver->setDefaultConnection($name);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Query/Builder.php | @@ -465,7 +465,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
// 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 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
$this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean');
- if (!$value instanceof Expression) {
+ if (! $value instanceof Expression) {
$this->addBinding($value, 'where');
}
@@ -1050,7 +1050,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
$this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean');
- if (!$value instanceof Expression) {
+ if (! $value instanceof Expression) {
$this->addBinding($value, 'having');
}
@@ -1371,7 +1371,7 @@ public function getFresh($columns = ['*'])
*/
protected function runSelect()
{
- return $this->connection->select($this->toSql(), $this->getBindings(), !$this->useWritePdo);
+ return $this->connection->select($this->toSql(), $this->getBindings(), ! $this->useWritePdo);
}
/**
@@ -1584,7 +1584,7 @@ public function exists()
*/
public function count($columns = '*')
{
- if (!is_array($columns)) {
+ if (! is_array($columns)) {
$columns = [$columns];
}
@@ -1690,7 +1690,7 @@ public function insert(array $values)
// 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];
}
@@ -1801,7 +1801,7 @@ public function delete($id = null)
// 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);
}
@@ -1855,7 +1855,7 @@ public function mergeWheres($wheres, $bindings)
protected function cleanBindings(array $bindings)
{
return array_values(array_filter($bindings, function ($binding) {
- return !$binding instanceof Expression;
+ return ! $binding instanceof Expression;
}));
}
@@ -1901,7 +1901,7 @@ public function getRawBindings()
*/
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}.");
}
@@ -1921,7 +1921,7 @@ public function setBindings(array $bindings, $type = 'where')
*/
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}.");
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -56,7 +56,7 @@ protected function compileComponents(Builder $query)
// 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 @@ protected function compileColumns(Builder $query, $columns)
// 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 @@ protected function compileJoinConstraint(array $clause)
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 @@ public function compileInsert(Builder $query, array $values)
// 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];
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -84,7 +84,7 @@ protected function compileUpdateColumns($values)
*/
protected function compileUpdateFrom(Builder $query)
{
- if (!isset($query->joins)) {
+ if (! isset($query->joins)) {
return '';
}
@@ -112,7 +112,7 @@ protected function compileUpdateWheres(Builder $query)
{
$baseWhere = $this->compileWheres($query);
- if (!isset($query->joins)) {
+ if (! isset($query->joins)) {
return $baseWhere;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php | @@ -31,7 +31,7 @@ public function compileInsert(Builder $query, array $values)
// 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];
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -46,7 +46,7 @@ public function compileSelect(Builder $query)
*/
protected function compileColumns(Builder $query, $columns)
{
- if (!is_null($query->aggregate)) {
+ if (! is_null($query->aggregate)) {
return;
}
@@ -77,7 +77,7 @@ protected function compileFrom(Builder $query, $table)
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 @@ protected function compileAnsiOffset(Builder $query, $components)
// 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)';
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Blueprint.php | @@ -58,7 +58,7 @@ public function __construct($table, Closure $callback = null)
{
$this->table = $table;
- if (!is_null($callback)) {
+ if (! is_null($callback)) {
$callback($this);
}
}
@@ -97,7 +97,7 @@ public function toSql(Connection $connection, Grammar $grammar)
$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 @@ public function toSql(Connection $connection, Grammar $grammar)
*/
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 @@ public function increments($column)
{
return $this->unsignedInteger($column, true);
}
-
+
/**
* Create a new auto-incrementing small integer (2-byte) column on the table.
*
@@ -994,7 +994,7 @@ public function getCommands()
public function getAddedColumns()
{
return array_filter($this->columns, function ($column) {
- return !$column->change;
+ return ! $column->change;
});
}
@@ -1006,7 +1006,7 @@ public function getAddedColumns()
public function getChangedColumns()
{
return array_filter($this->columns, function ($column) {
- return !!$column->change;
+ return ! ! $column->change;
});
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Builder.php | @@ -81,7 +81,7 @@ public function hasColumns($table, array $columns)
$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;
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Grammars/Grammar.php | @@ -97,11 +97,11 @@ public function compileForeign(Blueprint $blueprint, Fluent $command)
// 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 @@ protected function getTableWithColumnChanges(Blueprint $blueprint, Table $table)
// 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 @@ protected function mapFluentOptionToDoctrine($attribute)
*/
protected function mapFluentValueToDoctrine($option, $value)
{
- return $option == 'notnull' ? !$value : $value;
+ return $option == 'notnull' ? ! $value : $value;
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php | @@ -80,13 +80,13 @@ protected function compileCreateEncoding($sql, Connection $connection, Blueprint
{
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 @@ protected function typeTimeTz(Fluent $column)
*/
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 @@ protected function typeTimestamp(Fluent $column)
*/
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 @@ protected function modifyUnsigned(Blueprint $blueprint, Fluent $column)
*/
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 @@ protected function modifyCharset(Blueprint $blueprint, Fluent $column)
*/
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 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column)
*/
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 @@ protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
*/
protected function modifyFirst(Blueprint $blueprint, Fluent $column)
{
- if (!is_null($column->first)) {
+ if (! is_null($column->first)) {
return ' first';
}
}
@@ -664,7 +664,7 @@ protected function modifyFirst(Blueprint $blueprint, Fluent $column)
*/
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 @@ protected function modifyAfter(Blueprint $blueprint, Fluent $column)
*/
protected function modifyComment(Blueprint $blueprint, Fluent $column)
{
- if (!is_null($column->comment)) {
+ if (! is_null($column->comment)) {
return ' comment "'.$column->comment.'"';
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | @@ -522,7 +522,7 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column)
*/
protected function modifyDefault(Blueprint $blueprint, Fluent $column)
{
- if (!is_null($column->default)) {
+ if (! is_null($column->default)) {
return ' default '.$this->getDefaultValue($column->default);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php | @@ -84,11 +84,11 @@ protected function addForeignKeys(Blueprint $blueprint)
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 @@ protected function addPrimaryKeys(Blueprint $blueprint)
{
$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 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column)
*/
protected function modifyDefault(Blueprint $blueprint, Fluent $column)
{
- if (!is_null($column->default)) {
+ if (! is_null($column->default)) {
return ' default '.$this->getDefaultValue($column->default);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php | @@ -530,7 +530,7 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column)
*/
protected function modifyDefault(Blueprint $blueprint, Fluent $column)
{
- if (!is_null($column->default)) {
+ if (! is_null($column->default)) {
return ' default '.$this->getDefaultValue($column->default);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Encryption/BaseEncrypter.php | @@ -41,11 +41,11 @@ protected function getJsonPayload($payload)
// 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 @@ protected function getJsonPayload($payload)
*/
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']);
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Events/CallQueuedHandler.php | @@ -42,7 +42,7 @@ public function call(Job $job, array $data)
[$handler, $data['method']], unserialize($data['data'])
);
- if (!$job->isDeletedOrReleased()) {
+ if (! $job->isDeletedOrReleased()) {
$job->delete();
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Events/Dispatcher.php | @@ -207,7 +207,7 @@ public function fire($event, $payload = [], $halt = false)
// 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 @@ public function fire($event, $payload = [], $halt = false)
// 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 @@ public function getListeners($eventName)
{
$wildcards = $this->getWildcardListeners($eventName);
- if (!isset($this->sorted[$eventName])) {
+ if (! isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Filesystem/Filesystem.php | @@ -123,7 +123,7 @@ public function delete($paths)
foreach ($paths as $path) {
try {
- if (!@unlink($path)) {
+ if (! @unlink($path)) {
$success = false;
}
} catch (ErrorException $e) {
@@ -347,7 +347,7 @@ public function makeDirectory($path, $mode = 0755, $recursive = false, $force =
*/
public function copyDirectory($directory, $destination, $options = null)
{
- if (!$this->isDirectory($directory)) {
+ if (! $this->isDirectory($directory)) {
return false;
}
@@ -356,7 +356,7 @@ public function copyDirectory($directory, $destination, $options = null)
// 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 @@ public function copyDirectory($directory, $destination, $options = null)
if ($item->isDir()) {
$path = $item->getPathname();
- if (!$this->copyDirectory($path, $target, $options)) {
+ if (! $this->copyDirectory($path, $target, $options)) {
return false;
}
}
@@ -380,7 +380,7 @@ public function copyDirectory($directory, $destination, $options = null)
// 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 @@ public function copyDirectory($directory, $destination, $options = null)
*/
public function deleteDirectory($directory, $preserve = false)
{
- if (!$this->isDirectory($directory)) {
+ if (! $this->isDirectory($directory)) {
return false;
}
@@ -410,7 +410,7 @@ public function deleteDirectory($directory, $preserve = false)
// 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 @@ public function deleteDirectory($directory, $preserve = false)
}
}
- if (!$preserve) {
+ if (! $preserve) {
@rmdir($directory);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/AliasLoader.php | @@ -86,7 +86,7 @@ public function alias($class, $alias)
*/
public function register()
{
- if (!$this->registered) {
+ if (! $this->registered) {
$this->prependToLoaderStack();
$this->registered = true; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Application.php | @@ -517,7 +517,7 @@ public function registerConfiguredProviders()
*/
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 @@ public function loadDeferredProviders()
*/
public function loadDeferredProvider($service)
{
- if (!isset($this->deferredServices[$service])) {
+ if (! isset($this->deferredServices[$service])) {
return;
}
@@ -624,7 +624,7 @@ public function loadDeferredProvider($service)
// 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 @@ public function registerDeferredProvider($provider, $service = null)
$this->register($instance = new $provider($this));
- if (!$this->booted) {
+ if (! $this->booted) {
$this->booting(function () use ($instance) {
$this->bootProvider($instance);
});
@@ -980,7 +980,7 @@ public function configureMonologUsing(callable $callback)
*/
public function hasMonologConfigurator()
{
- return !is_null($this->monologConfigurator);
+ return ! is_null($this->monologConfigurator);
}
/**
@@ -1102,7 +1102,7 @@ protected function getKernel()
*/
public function getNamespace()
{
- if (!is_null($this->namespace)) {
+ if (! is_null($this->namespace)) {
return $this->namespace;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Auth/AuthenticatesUsers.php | @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Lang;
-use Illuminate\Support\Facades\Cache;
trait AuthenticatesUsers
{ | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Bootstrap/HandleExceptions.php | @@ -36,7 +36,7 @@ public function bootstrap(Application $app)
register_shutdown_function([$this, 'handleShutdown']);
- if (!$app->environment('testing')) {
+ if (! $app->environment('testing')) {
ini_set('display_errors', 'Off');
}
}
@@ -72,7 +72,7 @@ public function handleError($level, $message, $file = '', $line = 0, $context =
*/
public function handleException($e)
{
- if (!$e instanceof Exception) {
+ if (! $e instanceof Exception) {
$e = new FatalThrowableError($e);
}
@@ -114,7 +114,7 @@ protected function renderHttpResponse(Exception $e)
*/
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));
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php | @@ -34,7 +34,7 @@ public function bootstrap(Application $app)
// 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);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/EventGenerateCommand.php | @@ -33,7 +33,7 @@ public function fire()
);
foreach ($provider->listens() as $event => $listeners) {
- if (!Str::contains($event, '\\')) {
+ if (! Str::contains($event, '\\')) {
continue;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/HandlerEventCommand.php | @@ -41,7 +41,7 @@ protected function buildClass($name)
$event = $this->option('event');
- if (!Str::startsWith($event, $this->laravel->getNamespace())) {
+ if (! Str::startsWith($event, $this->laravel->getNamespace())) {
$event = $this->laravel->getNamespace().'Events\\'.$event;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/IlluminateCaster.php | @@ -46,8 +46,8 @@ public static function castApplication(Application $app)
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) {
// | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/Kernel.php | @@ -202,7 +202,7 @@ public function output()
*/
public function bootstrap()
{
- if (!$this->app->hasBeenBootstrapped()) {
+ if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/ListenerMakeCommand.php | @@ -55,7 +55,7 @@ protected function buildClass($name)
$event = $this->option('event');
- if (!Str::startsWith($event, $this->laravel->getNamespace())) {
+ if (! Str::startsWith($event, $this->laravel->getNamespace())) {
$event = $this->laravel->getNamespace().'Events\\'.$event;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/OptimizeCommand.php | @@ -65,7 +65,7 @@ public function fire()
$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 { | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/RouteListCommand.php | @@ -147,7 +147,7 @@ protected function getMiddleware($route)
$actionName = $route->getActionName();
- if (!empty($actionName) && $actionName !== 'Closure') {
+ if (! empty($actionName) && $actionName !== 'Closure') {
$middlewares = array_merge($middlewares, $this->getControllerMiddleware($actionName));
}
@@ -185,7 +185,7 @@ protected function getControllerMiddlewareFromInstance($controller, $method)
$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 @@ protected function getControllerMiddlewareFromInstance($controller, $method)
*/
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 @@ protected function getMethodPatterns($uri, $method)
*/
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;
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Console/VendorPublishCommand.php | @@ -101,7 +101,7 @@ private function publishTag($tag)
*/
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 @@ protected function publishDirectory($from, $to)
]);
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 @@ protected function publishDirectory($from, $to)
*/
protected function createParentDirectory($directory)
{
- if (!$this->files->isDirectory($directory)) {
+ if (! $this->files->isDirectory($directory)) {
$this->files->makeDirectory($directory, 0755, true);
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/EnvironmentDetector.php | @@ -47,7 +47,7 @@ protected function detectConsoleEnvironment(Closure $callback, array $args)
// 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));
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Exceptions/Handler.php | @@ -58,7 +58,7 @@ public function report(Exception $e)
*/
public function shouldReport(Exception $e)
{
- return !$this->shouldntReport($e);
+ return ! $this->shouldntReport($e);
}
/** | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Http/Kernel.php | @@ -4,7 +4,6 @@
use Exception;
use Throwable;
-use RuntimeException;
use Illuminate\Routing\Router;
use Illuminate\Pipeline\Pipeline;
use Illuminate\Support\Facades\Facade;
@@ -219,7 +218,7 @@ public function pushMiddleware($middleware)
*/
public function bootstrap()
{
- if (!$this->app->hasBeenBootstrapped()) {
+ if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php | @@ -80,7 +80,7 @@ protected function tokensMatch($request)
{
$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);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Testing/ApplicationTrait.php | @@ -162,7 +162,7 @@ public function session(array $data)
*/
protected function startSession()
{
- if (!$this->app['session']->isStarted()) {
+ if (! $this->app['session']->isStarted()) {
$this->app['session']->start();
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Testing/AssertionsTrait.php | @@ -45,7 +45,7 @@ public function assertViewHas($key, $value = null)
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 @@ public function assertViewHasAll(array $bindings)
*/
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.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Testing/CrawlerTrait.php | @@ -296,7 +296,7 @@ protected function receiveJson($data = null)
{
$this->seeJson();
- if (!is_null($data)) {
+ if (! is_null($data)) {
return $this->seeJson($data);
}
}
@@ -448,7 +448,7 @@ protected function seeHeader($headerName, $value = null)
$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 @@ protected function seeCookie($cookieName, $value = null)
$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 @@ protected function click($name)
{
$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 @@ protected function submitForm($buttonText, $inputs = [], $uploads = [])
*/
protected function fillForm($buttonText, $inputs = [])
{
- if (!is_string($buttonText)) {
+ if (! is_string($buttonText)) {
$inputs = $buttonText;
$buttonText = null;
@@ -657,7 +657,7 @@ protected function assertFilterProducesResults($filter)
{
$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 @@ protected function prepareUrlForRequest($uri)
$uri = substr($uri, 1);
}
- if (!Str::startsWith($uri, 'http')) {
+ if (! Str::startsWith($uri, 'http')) {
$uri = $this->baseUrl.'/'.$uri;
}
@@ -801,7 +801,7 @@ protected function transformHeadersToServerVars(array $headers)
$name = strtr(strtoupper($name), '-', '_');
if (! starts_with($name, $prefix) && $name != 'CONTENT_TYPE') {
- $name = $prefix . $name;
+ $name = $prefix.$name;
}
$server[$name] = $value; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Foundation/Testing/TestCase.php | @@ -32,7 +32,7 @@ abstract public function createApplication();
*/
public function setUp()
{
- if (!$this->app) {
+ if (! $this->app) {
$this->refreshApplication();
}
} | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | 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 @@ function abort($code, $message = '', array $headers = [])
}
}
-if (!function_exists('action')) {
+if (! function_exists('action')) {
/**
* Generate a URL to a controller action.
*
@@ -36,7 +36,7 @@ function action($name, $parameters = [], $absolute = true)
}
}
-if (!function_exists('app')) {
+if (! function_exists('app')) {
/**
* Get the available container instance.
*
@@ -54,7 +54,7 @@ function app($make = null, $parameters = [])
}
}
-if (!function_exists('app_path')) {
+if (! function_exists('app_path')) {
/**
* Get the path to the application folder.
*
@@ -67,7 +67,7 @@ function app_path($path = '')
}
}
-if (!function_exists('asset')) {
+if (! function_exists('asset')) {
/**
* Generate an asset path for the application.
*
@@ -81,7 +81,7 @@ function asset($path, $secure = null)
}
}
-if (!function_exists('auth')) {
+if (! function_exists('auth')) {
/**
* Get the available auth instance.
*
@@ -93,7 +93,7 @@ function auth()
}
}
-if (!function_exists('base_path')) {
+if (! function_exists('base_path')) {
/**
* Get the path to the base of the install.
*
@@ -106,7 +106,7 @@ function base_path($path = '')
}
}
-if (!function_exists('back')) {
+if (! function_exists('back')) {
/**
* Create a new redirect response to the previous location.
*
@@ -120,7 +120,7 @@ function back($status = 302, $headers = [])
}
}
-if (!function_exists('bcrypt')) {
+if (! function_exists('bcrypt')) {
/**
* Hash the given value.
*
@@ -134,7 +134,7 @@ function bcrypt($value, $options = [])
}
}
-if (!function_exists('config')) {
+if (! function_exists('config')) {
/**
* Get / set the specified configuration value.
*
@@ -158,7 +158,7 @@ function config($key = null, $default = null)
}
}
-if (!function_exists('config_path')) {
+if (! function_exists('config_path')) {
/**
* Get the configuration path.
*
@@ -171,7 +171,7 @@ function config_path($path = '')
}
}
-if (!function_exists('cookie')) {
+if (! function_exists('cookie')) {
/**
* Create a new cookie instance.
*
@@ -196,7 +196,7 @@ function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain
}
}
-if (!function_exists('csrf_field')) {
+if (! function_exists('csrf_field')) {
/**
* Generate a CSRF token form field.
*
@@ -208,7 +208,7 @@ function csrf_field()
}
}
-if (!function_exists('csrf_token')) {
+if (! function_exists('csrf_token')) {
/**
* Get the CSRF token value.
*
@@ -228,7 +228,7 @@ function csrf_token()
}
}
-if (!function_exists('database_path')) {
+if (! function_exists('database_path')) {
/**
* Get the database path.
*
@@ -241,7 +241,7 @@ function database_path($path = '')
}
}
-if (!function_exists('delete')) {
+if (! function_exists('delete')) {
/**
* Register a new DELETE route with the router.
*
@@ -255,7 +255,7 @@ function delete($uri, $action)
}
}
-if (!function_exists('factory')) {
+if (! function_exists('factory')) {
/**
* Create a model factory builder for a given class, name, and amount.
*
@@ -278,7 +278,7 @@ function factory()
}
}
-if (!function_exists('get')) {
+if (! function_exists('get')) {
/**
* Register a new GET route with the router.
*
@@ -292,7 +292,7 @@ function get($uri, $action)
}
}
-if (!function_exists('info')) {
+if (! function_exists('info')) {
/**
* Write some information to the log.
*
@@ -306,7 +306,7 @@ function info($message, $context = [])
}
}
-if (!function_exists('logger')) {
+if (! function_exists('logger')) {
/**
* Log a debug message to the logs.
*
@@ -324,7 +324,7 @@ function logger($message = null, array $context = [])
}
}
-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 @@ function method_field($method)
}
}
-if (!function_exists('old')) {
+if (! function_exists('old')) {
/**
* Retrieve an old input item.
*
@@ -351,7 +351,7 @@ function old($key = null, $default = null)
}
}
-if (!function_exists('patch')) {
+if (! function_exists('patch')) {
/**
* Register a new PATCH route with the router.
*
@@ -365,7 +365,7 @@ function patch($uri, $action)
}
}
-if (!function_exists('post')) {
+if (! function_exists('post')) {
/**
* Register a new POST route with the router.
*
@@ -379,7 +379,7 @@ function post($uri, $action)
}
}
-if (!function_exists('put')) {
+if (! function_exists('put')) {
/**
* Register a new PUT route with the router.
*
@@ -393,7 +393,7 @@ function put($uri, $action)
}
}
-if (!function_exists('public_path')) {
+if (! function_exists('public_path')) {
/**
* Get the path to the public folder.
*
@@ -406,7 +406,7 @@ function public_path($path = '')
}
}
-if (!function_exists('redirect')) {
+if (! function_exists('redirect')) {
/**
* Get an instance of the redirector.
*
@@ -426,7 +426,7 @@ function redirect($to = null, $status = 302, $headers = [], $secure = null)
}
}
-if (!function_exists('resource')) {
+if (! function_exists('resource')) {
/**
* Route a resource to a controller.
*
@@ -441,7 +441,7 @@ function resource($name, $controller, array $options = [])
}
}
-if (!function_exists('response')) {
+if (! function_exists('response')) {
/**
* Return a new response from the application.
*
@@ -462,7 +462,7 @@ function response($content = '', $status = 200, array $headers = [])
}
}
-if (!function_exists('route')) {
+if (! function_exists('route')) {
/**
* Generate a URL to a named route.
*
@@ -478,7 +478,7 @@ function route($name, $parameters = [], $absolute = true, $route = null)
}
}
-if (!function_exists('secure_asset')) {
+if (! function_exists('secure_asset')) {
/**
* Generate an asset path for the application.
*
@@ -491,7 +491,7 @@ function secure_asset($path)
}
}
-if (!function_exists('secure_url')) {
+if (! function_exists('secure_url')) {
/**
* Generate a HTTPS url for the application.
*
@@ -505,7 +505,7 @@ function secure_url($path, $parameters = [])
}
}
-if (!function_exists('session')) {
+if (! function_exists('session')) {
/**
* Get / set the specified session value.
*
@@ -529,7 +529,7 @@ function session($key = null, $default = null)
}
}
-if (!function_exists('storage_path')) {
+if (! function_exists('storage_path')) {
/**
* Get the path to the storage folder.
*
@@ -542,7 +542,7 @@ function storage_path($path = '')
}
}
-if (!function_exists('trans')) {
+if (! function_exists('trans')) {
/**
* Translate the given message.
*
@@ -562,7 +562,7 @@ function trans($id = null, $parameters = [], $domain = 'messages', $locale = nul
}
}
-if (!function_exists('trans_choice')) {
+if (! function_exists('trans_choice')) {
/**
* Translates the given message based on a count.
*
@@ -579,7 +579,7 @@ function trans_choice($id, $number, array $parameters = [], $domain = 'messages'
}
}
-if (!function_exists('url')) {
+if (! function_exists('url')) {
/**
* Generate a url for the application.
*
@@ -594,7 +594,7 @@ function url($path = null, $parameters = [], $secure = null)
}
}
-if (!function_exists('view')) {
+if (! function_exists('view')) {
/**
* Get the evaluated view contents for the given view.
*
@@ -615,7 +615,7 @@ function view($view = null, $data = [], $mergeData = [])
}
}
-if (!function_exists('env')) {
+if (! function_exists('env')) {
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
@@ -657,7 +657,7 @@ function env($key, $default = null)
}
}
-if (!function_exists('event')) {
+if (! function_exists('event')) {
/**
* Fire an event and call the listeners.
*
@@ -672,7 +672,7 @@ function event($event, $payload = [], $halt = false)
}
}
-if (!function_exists('elixir')) {
+if (! function_exists('elixir')) {
/**
* Get the path to a versioned Elixir file.
* | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Http/RedirectResponse.php | @@ -77,7 +77,7 @@ public function withInput(array $input = null)
$value = array_filter($value, $callback);
}
- return !$value instanceof UploadedFile;
+ return ! $value instanceof UploadedFile;
}));
return $this; | true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Http/Request.php | @@ -224,7 +224,7 @@ public function exists($key)
$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 @@ protected function isEmptyString($key)
$boolOrArray = is_bool($value) || is_array($value);
- return !$boolOrArray && trim((string) $value) === '';
+ return ! $boolOrArray && trim((string) $value) === '';
}
/**
@@ -348,7 +348,7 @@ public function query($key = null, $default = null)
*/
public function hasCookie($key)
{
- return !is_null($this->cookie($key));
+ return ! is_null($this->cookie($key));
}
/**
@@ -383,7 +383,7 @@ public function file($key = null, $default = null)
*/
public function hasFile($key)
{
- if (!is_array($files = $this->file($key))) {
+ if (! is_array($files = $this->file($key))) {
$files = [$files];
}
@@ -452,7 +452,7 @@ public function old($key = null, $default = null)
*/
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 @@ public function replace(array $input)
*/
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 @@ public function prefers($contentTypes)
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 @@ public function duplicate(array $query = null, array $request = null, array $att
*/
public function session()
{
- if (!$this->hasSession()) {
+ if (! $this->hasSession()) {
throw new RuntimeException('Session store not set on request.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Log/Writer.php | @@ -271,7 +271,7 @@ public function useErrorLog($level = 'debug', $messageType = ErrorLogHandler::OP
*/
public function listen(Closure $callback)
{
- if (!isset($this->dispatcher)) {
+ if (! isset($this->dispatcher)) {
throw new RuntimeException('Events dispatcher has not been set.');
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Mail/Mailer.php | @@ -244,7 +244,7 @@ public function laterOn($queue, $delay, $view, array $data, $callback)
*/
protected function buildQueueCallable($callback)
{
- if (!$callback instanceof Closure) {
+ if (! $callback instanceof Closure) {
return $callback;
}
@@ -401,7 +401,7 @@ protected function createMessage()
// 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']);
}
| true |
Other | laravel | framework | 2c64b62f61ba0bf51fc1578c9286abead664e231.json | fix merge conflicts. | src/Illuminate/Pagination/AbstractPaginator.php | @@ -275,7 +275,7 @@ public function currentPage()
*/
public function hasPages()
{
- return !($this->currentPage() == 1 && !$this->hasMorePages());
+ return ! ($this->currentPage() == 1 && ! $this->hasMorePages());
}
/** | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.