Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 22, 2025
2 parents fa28f8e + 066b740 commit 9633ac5
Show file tree
Hide file tree
Showing 91 changed files with 1,466 additions and 434 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"fakerphp/faker": "^1.24",
"guzzlehttp/promises": "^2.0.3",
"guzzlehttp/psr7": "^2.4",
"laravel/pint": "^1.18",
"league/flysystem-aws-s3-v3": "^3.25.1",
"league/flysystem-ftp": "^3.25.1",
"league/flysystem-path-prefixing": "^3.25.1",
Expand Down
9 changes: 9 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"preset": "empty",
"rules": {
"method_chaining_indentation": true
},
"exclude": [
"tests"
]
}
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
public function updateRememberToken(UserContract $user, #[\SensitiveParameter] $token)
{
$this->connection->table($this->table)
->where($user->getAuthIdentifierName(), $user->getAuthIdentifier())
->update([$user->getRememberTokenName() => $token]);
->where($user->getAuthIdentifierName(), $user->getAuthIdentifier())
->update([$user->getRememberTokenName() => $token]);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public function retrieveById($identifier)
$model = $this->createModel();

return $this->newModelQuery($model)
->where($model->getAuthIdentifierName(), $identifier)
->first();
->where($model->getAuthIdentifierName(), $identifier)
->first();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ protected function retrieveChannelOptions($channel)
*/
protected function channelNameMatchesPattern($channel, $pattern)
{
$pattern = str_replace('.', '\.', $pattern);

return preg_match('/^'.preg_replace('/\{(.*?)\}/', '([^\.]+)', $pattern).'$/', $channel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function decodePusherResponse($request, $response)
}

return response()->json(json_decode($response, true))
->withCallback($request->callback);
->withCallback($request->callback);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Bus/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ public function add($jobs)

return with($this->prepareBatchedChain($job), function ($chain) {
return $chain->first()
->allOnQueue($this->options['queue'] ?? null)
->allOnConnection($this->options['connection'] ?? null)
->chain($chain->slice(1)->values()->all());
->allOnQueue($this->options['queue'] ?? null)
->allOnConnection($this->options['connection'] ?? null)
->chain($chain->slice(1)->values()->all());
});
} else {
$job->withBatchId($this->id);
Expand Down
26 changes: 13 additions & 13 deletions src/Illuminate/Bus/DatabaseBatchRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public function __construct(BatchFactory $factory, Connection $connection, strin
public function get($limit = 50, $before = null)
{
return $this->connection->table($this->table)
->orderByDesc('id')
->take($limit)
->when($before, fn ($q) => $q->where('id', '<', $before))
->get()
->map(function ($batch) {
return $this->toBatch($batch);
})
->all();
->orderByDesc('id')
->take($limit)
->when($before, fn ($q) => $q->where('id', '<', $before))
->get()
->map(function ($batch) {
return $this->toBatch($batch);
})
->all();
}

/**
Expand All @@ -77,9 +77,9 @@ public function get($limit = 50, $before = null)
public function find(string $batchId)
{
$batch = $this->connection->table($this->table)
->useWritePdo()
->where('id', $batchId)
->first();
->useWritePdo()
->where('id', $batchId)
->first();

if ($batch) {
return $this->toBatch($batch);
Expand Down Expand Up @@ -185,8 +185,8 @@ protected function updateAtomicValues(string $batchId, Closure $callback)
{
return $this->connection->transaction(function () use ($batchId, $callback) {
$batch = $this->connection->table($this->table)->where('id', $batchId)
->lockForUpdate()
->first();
->lockForUpdate()
->first();

return is_null($batch) ? [] : tap($callback($batch), function ($values) use ($batchId) {
$this->connection->table($this->table)->where('id', $batchId)->update($values);
Expand Down
10 changes: 5 additions & 5 deletions src/Illuminate/Cache/DatabaseLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public function release()
{
if ($this->isOwnedByCurrentProcess()) {
$this->connection->table($this->table)
->where('key', $this->name)
->where('owner', $this->owner)
->delete();
->where('key', $this->name)
->where('owner', $this->owner)
->delete();

return true;
}
Expand All @@ -130,8 +130,8 @@ public function release()
public function forceRelease()
{
$this->connection->table($this->table)
->where('key', $this->name)
->delete();
->where('key', $this->name)
->delete();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function incrementOrDecrement($key, $value, Closure $callback)
$prefixed = $this->prefix.$key;

$cache = $this->table()->where('key', $prefixed)
->lockForUpdate()->first();
->lockForUpdate()->first();

// If there is no value in the cache, we will return false here. Otherwise the
// value will be decrypted and we will proceed with this function to either
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/MemcachedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($memcached, $prefix = '')
$this->memcached = $memcached;

$this->onVersionThree = (new ReflectionMethod('Memcached', 'getMulti'))
->getNumberOfParameters() == 2;
->getNumberOfParameters() == 2;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ protected function getSeconds($ttl)
*
* @return string|null
*/
protected function getName()
public function getName()
{
return $this->config['store'] ?? null;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ public function collapse()
*/
public function collapseWithKeys()
{
if (! $this->items) {
return new static;
}

$results = [];

foreach ($this->items as $key => $values) {
Expand Down
26 changes: 13 additions & 13 deletions src/Illuminate/Console/Scheduling/ManagesFrequencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ protected function hourBasedSchedule($minutes, $hours)
$hours = is_array($hours) ? implode(',', $hours) : $hours;

return $this->spliceIntoPosition(1, $minutes)
->spliceIntoPosition(2, $hours);
->spliceIntoPosition(2, $hours);
}

/**
Expand Down Expand Up @@ -492,8 +492,8 @@ public function sundays()
public function weekly()
{
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, 0)
->spliceIntoPosition(5, 0);
->spliceIntoPosition(2, 0)
->spliceIntoPosition(5, 0);
}

/**
Expand All @@ -518,8 +518,8 @@ public function weeklyOn($dayOfWeek, $time = '0:0')
public function monthly()
{
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1);
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1);
}

/**
Expand Down Expand Up @@ -574,9 +574,9 @@ public function lastDayOfMonth($time = '0:0')
public function quarterly()
{
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1)
->spliceIntoPosition(4, '1-12/3');
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1)
->spliceIntoPosition(4, '1-12/3');
}

/**
Expand All @@ -591,7 +591,7 @@ public function quarterlyOn($dayOfQuarter = 1, $time = '0:0')
$this->dailyAt($time);

return $this->spliceIntoPosition(3, $dayOfQuarter)
->spliceIntoPosition(4, '1-12/3');
->spliceIntoPosition(4, '1-12/3');
}

/**
Expand All @@ -602,9 +602,9 @@ public function quarterlyOn($dayOfQuarter = 1, $time = '0:0')
public function yearly()
{
return $this->spliceIntoPosition(1, 0)
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1)
->spliceIntoPosition(4, 1);
->spliceIntoPosition(2, 0)
->spliceIntoPosition(3, 1)
->spliceIntoPosition(4, 1);
}

/**
Expand All @@ -620,7 +620,7 @@ public function yearlyOn($month = 1, $dayOfMonth = 1, $time = '0:0')
$this->dailyAt($time);

return $this->spliceIntoPosition(3, $dayOfMonth)
->spliceIntoPosition(4, $month);
->spliceIntoPosition(4, $month);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function cursor($query, $bindings = [], $useReadPdo = true)
// mode and prepare the bindings for the query. Once that's done we will be
// ready to execute the query against the database and return the cursor.
$statement = $this->prepared($this->getPdoForSelect($useReadPdo)
->prepare($query));
->prepare($query));

$this->bindValues(
$statement, $this->prepareBindings($bindings)
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Database/Console/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ protected function schemaState(Connection $connection)
$migrationTable = is_array($migrations) ? ($migrations['table'] ?? 'migrations') : $migrations;

return $connection->getSchemaState()
->withMigrationTable($migrationTable)
->handleOutputUsing(function ($type, $buffer) {
$this->output->write($buffer);
});
->withMigrationTable($migrationTable)
->handleOutputUsing(function ($type, $buffer) {
$this->output->write($buffer);
});
}

/**
Expand Down
20 changes: 10 additions & 10 deletions src/Illuminate/Database/Console/Migrations/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ public function handle()
protected function getStatusFor(array $ran, array $batches)
{
return (new Collection($this->getAllMigrationFiles()))
->map(function ($migration) use ($ran, $batches) {
$migrationName = $this->migrator->getMigrationName($migration);
->map(function ($migration) use ($ran, $batches) {
$migrationName = $this->migrator->getMigrationName($migration);

$status = in_array($migrationName, $ran)
? '<fg=green;options=bold>Ran</>'
: '<fg=yellow;options=bold>Pending</>';
$status = in_array($migrationName, $ran)
? '<fg=green;options=bold>Ran</>'
: '<fg=yellow;options=bold>Pending</>';

if (in_array($migrationName, $ran)) {
$status = '['.$batches[$migrationName].'] '.$status;
}
if (in_array($migrationName, $ran)) {
$status = '['.$batches[$migrationName].'] '.$status;
}

return [$migrationName, $status];
});
return [$migrationName, $status];
});
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Console/Seeds/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ protected function getSeeder()
}

return $this->laravel->make($class)
->setContainer($this->laravel)
->setCommand($this);
->setContainer($this->laravel)
->setCommand($this);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Database/Console/WipeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public function handle()
protected function dropAllTables($database)
{
$this->laravel['db']->connection($database)
->getSchemaBuilder()
->dropAllTables();
->getSchemaBuilder()
->dropAllTables();
}

/**
Expand All @@ -82,8 +82,8 @@ protected function dropAllTables($database)
protected function dropAllViews($database)
{
$this->laravel['db']->connection($database)
->getSchemaBuilder()
->dropAllViews();
->getSchemaBuilder()
->dropAllViews();
}

/**
Expand All @@ -95,8 +95,8 @@ protected function dropAllViews($database)
protected function dropAllTypes($database)
{
$this->laravel['db']->connection($database)
->getSchemaBuilder()
->dropAllTypes();
->getSchemaBuilder()
->dropAllTypes();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/DatabaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected function configuration($name)
}

return (new ConfigurationUrlParser)
->parseConfiguration($config);
->parseConfiguration($config);
}

/**
Expand Down Expand Up @@ -374,8 +374,8 @@ protected function refreshPdoConnections($name)
);

return $this->connections[$name]
->setPdo($fresh->getRawPdo())
->setReadPdo($fresh->getRawReadPdo());
->setPdo($fresh->getRawPdo())
->setReadPdo($fresh->getRawReadPdo());
}

/**
Expand Down
Loading

0 comments on commit 9633ac5

Please sign in to comment.