8000 Apply fixes from StyleCI (#29062) · laravel/framework@d4edbf5 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4edbf5

Browse files
authored
Apply fixes from StyleCI (#29062)
1 parent d138303 commit d4edbf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+129
-129
lines changed

src/Illuminate/Auth/Access/Gate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function resource($name, $class, array $abilities = null)
151151
protected function buildAbilityCallback($ability, $callback)
152152
{
153153
return function () use ($ability, $callback) {
154-
list($class, $method) = Str::parseCallback($callback);
154+
[$class, $method] = Str::parseCallback($callback);
155155

156156
$policy = $this->resolvePolicy($class);
157157

src/Illuminate/Auth/Passwords/PasswordBroker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function validator(Closure $callback)
146146
public function validateNewPassword(array $credentials)
147147
{
148148
if (isset($this->passwordValidator)) {
149-
list($password, $confirm) = [
149+
[$password, $confirm] = [
150150
$credentials['password'],
151151
$credentials['password_confirmation'],
152152
];
@@ -167,7 +167,7 @@ public function validateNewPassword(array $credentials)
167167
*/
168168
protected function validatePasswordWithDefaults(array $credentials)
169169
{
170-
list($password, $confirm) = [
170+
[$password, $confirm] = [
171171
$credentials['password'],
172172
$credentials['password_confirmation'],
173173
];

src/Illuminate/Cache/MemcachedConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function createMemcachedInstance($connectionId)
7878
*/
7979
protected function setCredentials($memcached, $credentials)
8080
{
81-
list($username, $password) = $credentials;
81+
[$username, $password] = $credentials;
8282

8383
$memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
8484

src/Illuminate/Config/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getMany($keys)
6565

6666
foreach ($keys as $key => $default) {
6767
if (is_numeric($key)) {
68-
list($key, $default) = [$default, null];
68+
[$key, $default] = [$default, null];
6969
}
7070

7171
$config[$key] = Arr::get($this->items, $key, $default);

src/Illuminate/Console/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function __construct()
123123
*/
124124
protected function configureUsingFluentDefinition()
125125
{
126-
list($name, $arguments, $options) = Parser::parse($this->signature);
126+
[$name, $arguments, $options] = Parser::parse($this->signature);
127127

128128
parent::__construct($this->name = $name);
129129

src/Illuminate/Console/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected static function parameters(array $tokens)
8282
*/
8383
protected static function parseArgument($token)
8484
{
85-
list($token, $description) = static::extractDescription($token);
85+
[$token, $description] = static::extractDescription($token);
8686

8787
switch (true) {
8888
case Str::endsWith($token, '?*'):
@@ -108,7 +108,7 @@ protected static function parseArgument($token)
108108
*/
109109
protected static function parseOption($token)
110110
{
111-
list($token, $description) = static::extractDescription($token);
111+
[$token, $description] = static::extractDescription($token);
112112

113113
$matches = preg_split('/\s*\|\s*/', $token, 2);
114114

src/Illuminate/Cookie/CookieJar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CookieJar implements JarContract
6262
*/
6363
public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null)
6464
{
65-
list($path, $domain, $secure, $sameSite) = $this->getPathAndDomain($path, $domain, $secure, $sameSite);
65+
[$path, $domain, $secure, $sameSite] = $this->getPathAndDomain($path, $domain, $secure, $sameSite);
6666

6767
$time = ($minutes == 0) ? 0 : $this->availableAt($minutes * 60);
6868

@@ -176,7 +176,7 @@ protected function getPathAndDomain($path, $domain, $secure = null, $sameSite =
176176
*/
177177
public function setDefaultPathAndDomain($path, $domain, $secure = false, $sameSite = null)
178178
{
179-
list($this->path, $this->domain, $this->secure, $this->sameSite) = [$path, $domain, $secure, $sameSite];
179+
[$this->path, $this->domain, $this->secure, $this->sameSite] = [$path, $domain, $secure, $sameSite];
180180

181181
return $this;
182182
}

src/Illuminate/Database/Connectors/Connector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Connector
3535
*/
3636
public function createConnection($dsn, array $config, array $options)
3737
{
38-
list($username, $password) = [
38+
[$username, $password] = [
3939
$config['username'] ?? null, $config['password'] ?? null,
4040
];
4141

src/Illuminate/Database/DatabaseManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($app, ConnectionFactory $factory)
6262
*/
6363
public function connection($name = null)
6464
{
65-
list($database, $type) = $this->parseConnectionName($name);
65+
[$database, $type] = $this->parseConnectionName($name);
6666

6767
$name = $name ?: $database;
6868

src/Illuminate/Database/Eloquent/Builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
239239
*/
240240
public function orWhere($column, $operator = null, $value = null)
241241
{
242-
list($value, $operator) = $this->query->prepareValueAndOperator(
242+
[$value, $operator] = $this->query->prepareValueAndOperator(
243243
$value, $operator, func_num_args() === 2
244244
);
245245

@@ -880,7 +880,7 @@ public function scopes(array $scopes)
880880
// the parameter list is empty, so we will format the scope name and these
881881
// parameters here. Then, we'll be ready to call the scope on the model.
882882
if (is_int($scope)) {
883-
list($scope, $parameters) = [$parameters, []];
883+
[$scope, $parameters] = [$parameters, []];
884884
}
885885

886886
// Next we'll pass the scope callback to the callScope method which will take
@@ -913,7 +913,7 @@ public function applyScopes()
913913
continue;
914914
}
915915

916-
$builder->callScope( 10000 function (Builder $builder) use ($scope) {
916+
$builder->callScope(function (self $builder) use ($scope) {
917917
// If the scope is a Closure we will just go ahead and call the scope with the
918918
// builder instance. The "callScope" method will properly group the clauses
919919
// that are added to this query so "where" clauses maintain proper logic.
@@ -1085,7 +1085,7 @@ protected function parseWithRelations(array $relations)
10851085
if (is_numeric($name)) {
10861086
$name = $constraints;
10871087

1088-
list($name, $constraints) = Str::contains($name, ':')
1088+
[$name, $constraints] = Str::contains($name, ':')
10891089
? $this->createSelectWithConstraint($name)
10901090
: [$name, function () {
10911091
//

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ protected function isDateAttribute($key)
613613
*/
614614
public function fillJsonAttribute($key, $value)
615615
{
616-
list($key, $path) = explode('->', $key, 2);
616+
[$key, $path] = explode('->', $key, 2);
617617

618618
$this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue(
619619
$path, $key, $value

src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function morphOne($related, $name, $type = null, $id = null, $localKey =
9191
{
9292
$instance = $this->newRelatedInstance($related);
9393

94-
list($type, $id) = $this->getMorphs($name, $type, $id);
94+
[$type, $id] = $this->getMorphs($name, $type, $id);
9595

9696
$table = $instance->getTable();
9797

@@ -183,7 +183,7 @@ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null
183183
// use that to get both the class and foreign key that will be utilized.
184184
$name = $name ?: $this->guessBelongsToRelation();
185185

186-
list($type, $id) = $this->getMorphs(
186+
[$type, $id] = $this->getMorphs(
187187
Str::snake($name), $type, $id
188188
);
189189

@@ -266,7 +266,7 @@ public static function getActualClassNameForMorph($class)
266266
*/
267267
protected function guessBelongsToRelation()
268268
{
269-
list($one, $two, $caller) = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
269+
[$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
270270

271271
return $caller['function'];
272272
}
@@ -366,7 +366,7 @@ public function morphMany($related, $name, $type = null, $id = null, $localKey =
366366
// Here we will gather up the morph type and ID for the relationship so that we
367367
// can properly query the intermediate table of a relation. Finally, we will
368368
// get the table and create the relationship instances for the developers.
369-
list($type, $id) = $this->getMorphs($name, $type, $id);
369+
[$type, $id] = $this->getMorphs($name, $type, $id);
370370

371371
$table = $instance->getTable();
372372

src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function withCount($relations)
202202
unset($alias);
203203

204204
if (count($segments) == 3 && Str::lower($segments[1]) == 'as') {
205-
list($name, $alias) = [$segments[0], $segments[2]];
205+
[$name, $alias] = [$segments[0], $segments[2]];
206206
}
207207

208208
$relation = $this->getRelationWithoutConstraints($name);

src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function formatRecordsList(array $records)
133133
{
134134
return collect($records)->mapWithKeys(function ($attributes, $id) {
135135
if (! is_array($attributes)) {
136-
list($id, $attributes) = [$attributes, []];
136+
[$id, $attributes] = [$attributes, []];
137137
}
138138

139139
return [$id => $attributes];
@@ -258,7 +258,7 @@ protected function formatAttachRecords($ids, array $attributes)
258258
*/
259259
protected function formatAttachRecord($key, $value, $attributes, $hasTimestamps)
260260
{
261-
list($id, $attributes) = $this->extractAttachIdAndAttributes($key, $value, $attributes);
261+
[$id, $attributes] = $this->extractAttachIdAndAttributes($key, $value, $attributes);
262262

263263
return array_merge(
264264
$this->baseAttachRecord($id, $hasTimestamps), $this->castAttributes($attributes)

src/Illuminate/Database/Query/Builder.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function select($columns = ['*'])
234234
*/
235235
public function selectSub($query, $as)
236236
{
237-
list($query, $bindings) = $this->createSub($query);
237+
[$query, $bindings] = $this->createSub($query);
238238

239239
return $this->selectRaw(
240240
'('.$query.') as '.$this->grammar->wrap($as), $bindings
@@ -270,7 +270,7 @@ public function selectRaw($expression, array $bindings = [])
270270
*/
271271
public function fromSub($query, $as)
272272
{
273-
list($query, $bindings) = $this->createSub($query);
273+
[$query, $bindings] = $this->createSub($query);
274274

275275
return $this->fromRaw('('.$query.') as '.$this->grammar->wrap($as), $bindings);
276276
}
@@ -439,7 +439,7 @@ public function joinWhere($table, $first, $operator, $second, $type = 'inner')
439439
*/
440440
public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false)
441441
{
442-
list($query, $bindings) = $this->createSub($query);
442+
[$query, $bindings] = $this->createSub($query);
443443

444444
$expression = '('.$query.') as '.$this->grammar->wrap($as);
445445

@@ -591,7 +591,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
591591
// Here we will make some assumptions about the operator. If only 2 values are
592592
// passed to the method, we will assume that the operator is an equals sign
593593
// and keep going. Otherwise, we'll require the operator to be passed in.
594-
list($value, $operator) = $this->prepareValueAndOperator(
594+
[$value, $operator] = $this->prepareValueAndOperator(
595595
$value, $operator, func_num_args() === 2
596596
);
597597

@@ -606,7 +606,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
606606
// assume that the developer is just short-cutting the '=' operators and
607607
// we will set the operators to '=' and set the values appropriately.
608608
if ($this->invalidOperator($operator)) {
609-
list($value, $operator) = [$operator, '='];
609+
[$value, $operator] = [$operator, '='];
610610
}
611611

612612
// If the value is a Closure, it means the developer is performing an entire
@@ -725,7 +725,7 @@ protected function invalidOperator($operator)
725725
*/
726726
public function orWhere($column, $operator = null, $value = null)
727727
{
728-
list($value, $operator) = $this->prepareValueAndOperator(
728+
[$value, $operator] = $this->prepareValueAndOperator(
729729
$value, $operator, func_num_args() === 2
730730
);
731731

@@ -754,7 +754,7 @@ public function whereColumn($first, $operator = null, $second = null, $boolean =
754754
// assume that the developer is just short-cutting the '=' operators and
755755
// we will set the operators to '=' and set the values appropriately.
756756
if ($this->invalidOperator($operator)) {
757-
list($second, $operator) = [$operator, '='];
757+
[$second, $operator] = [$operator, '='];
758758
}
759759

760760
// Finally, we will add this where clause into this array of clauses that we
@@ -1066,7 +1066,7 @@ public function orWhereNotNull($column)
10661066
*/
10671067
public function whereDate($column, $operator, $value = null, $boolean = 'and')
10681068
{
1069-
list($value, $operator) = $this->prepareValueAndOperator(
1069+
[$value, $operator] = $this->prepareValueAndOperator(
10701070
$value, $operator, func_num_args() === 2
10711071
);
10721072

@@ -1083,7 +1083,7 @@ public function whereDate($column, $operator, $value = null, $boolean = 'and')
10831083
*/
10841084
public function orWhereDate($column, $operator, $value = null)
10851085
{
1086-
list($value, $operator) = $this->prepareValueAndOperator(
1086+
[$value, $operator] = $this->prepareValueAndOperator(
10871087
$value, $operator, func_num_args() === 2
10881088
);
10891089

@@ -1101,7 +1101,7 @@ public function orWhereDate($column, $operator, $value = null)
11011101
*/
11021102
public function whereTime($column, $operator, $value = null, $boolean = 'and')
11031103
{
1104-
list($value, $operator) = $this->prepareValueAndOperator(
1104+
[$value, $operator] = $this->prepareValueAndOperator(
11051105
$value, $operator, func_num_args() === 2
11061106
);
11071107

@@ -1118,7 +1118,7 @@ public function whereTime($column, $operator, $value = null, $boolean = 'and')
11181118
*/
11191119
public function orWhereTime($column, $operator, $value = null)
11201120
{
1121-
list($value, $operator) = $this->prepareValueAndOperator(
1121+
[$value, $operator] = $this->prepareValueAndOperator(
11221122
$value, $operator, func_num_args() === 2
11231123
);
11241124

@@ -1136,7 +1136,7 @@ public function orWhereTime($column, $operator, $value = null)
11361136
*/
11371137
public function whereDay($column, $operator, $value = null, $boolean = 'and')
11381138
{
1139-
list($value, $operator) = $this->prepareValueAndOperator(
1139+
[$value, $operator] = $this->prepareValueAndOperator(
11401140
$value, $operator, func_num_args() === 2
11411141
);
11421142

@@ -1153,7 +1153,7 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
11531153
*/
11541154
public function orWhereDay($column, $operator, $value = null)
11551155
{
1156-
list($value, $operator) = $this->prepareValueAndOperator(
1156+
[$value, $operator] = $this->prepareValueAndOperator(
11571157
$value, $operator, func_num_args() === 2
11581158
);
11591159

@@ -1171,7 +1171,7 @@ public function orWhereDay($column, $operator, $value = null)
11711171
*/
11721172
public function whereMonth($column, $operator, $value = null, $boolean = 'and')
11731173
{
1174-
list($value, $operator) = $this->prepareValueAndOperator(
1174+
[$value, $operator] = $this->prepareValueAndOperator(
11751175
$value, $operator, func_num_args() === 2
11761176
);
11771177

@@ -1188,7 +1188,7 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
11881188
*/
11891189
public function orWhereMonth($column, $operator, $value = null)
11901190
{
1191-
list($value, $operator) = $this->prepareValueAndOperator(
1191+
[$value, $operator] = $this->prepareValueAndOperator(
11921192
$value, $operator, func_num_args() === 2
11931193
);
11941194

@@ -1206,7 +1206,7 @@ public function orWhereMonth($column, $operator, $value = null)
12061206
*/
12071207
public function whereYear($column, $operator, $value = null, $boolean = 'and')
12081208
{
1209-
list($value, $operator) = $this->prepareValueAndOperator(
1209+
[$value, $operator] = $this->prepareValueAndOperator(
12101210
$value, $operator, func_num_args() === 2
12111211
);
12121212

@@ -1223,7 +1223,7 @@ public function whereYear($column, $operator, $value = null, $boolean = 'and')
12231223
*/
12241224
public function orWhereYear($column, $operator, $value = null)
12251225
{
1226-
list($value, $operator) = $this->prepareValueAndOperator(
1226+
[$value, $operator] = $this->prepareValueAndOperator(
12271227
$value, $operator, func_num_args() === 2
12281228
);
12291229

@@ -1588,15 +1588,15 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
15881588
// Here we will make some assumptions about the operator. If only 2 values are
15891589
// passed to the method, we will assume that the operator is an equals sign
15901590
// and keep going. Otherwise, we'll require the operator to be passed in.
1591-
list($value, $operator) = $this->prepareValueAndOperator(
1591+
[$value, $operator] = $this->prepareValueAndOperator(
15921592
$value, $operator, func_num_args() === 2
15931593
);
15941594

15951595
// If the given operator is not found in the list of valid operators we will
15961596
// assume that the developer is just short-cutting the '=' operators and
15971597
// we will set the operators to '=' and set the values appropriately.
15981598
if ($this->invalidOperator($operator)) {
1599-
list($value, $operator) = [$operator, '='];
1599+
[$value, $operator] = [$operator, '='];
16001600
}
16011601

16021602
$this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean');
@@ -1618,7 +1618,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
16181618
*/
16191619
public function orHaving($column, $operator = null, $value = null)
16201620
{
1621-
list($value, $operator) = $this->prepareValueAndOperator(
1621+
[$value, $operator] = $this->prepareValueAndOperator(
16221622
$value, $operator, func_num_args() === 2
16231623
);
16241624

0 commit comments

Comments
 (0)
0