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'], ... | 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]);
... | 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... | 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 Symf... | 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 valu... | 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)
{
retu... | 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->... | 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|\Ill... | 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 = ['*'])
... | 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... | 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',
- ... | 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'));
}
- ... | 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->wher... | 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(... | 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()
{
- retu... | 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)) {
+ ... | 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_nul... | 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;
- /**
- * C... | 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))) {
... | 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... | 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-... | 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!');
... | 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, tr... | 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... | 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)) {
... | 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... | 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 conveni... | 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)->e... | 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... | 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)
... | 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'));
- ... | 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.
- ... | 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... | 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);
}
... | 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[$thi... | 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 @@ ... | 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 = ... | 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 funct... | 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.
-... | 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 se... | 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... | 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(Builde... | 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... | 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(Bui... | 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 $gram... | 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), $tableColu... | 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... | 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_... | 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->getDefault... | 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-... | 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->getDefault... | 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 encry... | 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... | 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 fu... | 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 $re... | 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 functio... | 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 a... | 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)) {
+ $result... | 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');
... | 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->getControllerMi... | 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... | 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 "... | 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->h... | 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->e... | 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 V... | 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... | 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 (!func... | 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 func... | 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... | 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 @@ pr... | 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.