Skip to content

Commit 2042147

Browse files
authored
[11.x] consistent multiline constructors (#53566)
* consistent multiline constructors - trailing comma - closing parenthese on new line * standardize multiline constructors - first parameter on new line - trailing commas - parenthese on new line
1 parent 2b388bc commit 2042147

File tree

26 files changed

+174
-125
lines changed

26 files changed

+174
-125
lines changed

src/Illuminate/Auth/Access/Gate.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,15 @@ class Gate implements GateContract
9696
* @param callable|null $guessPolicyNamesUsingCallback
9797
* @return void
9898
*/
99-
public function __construct(Container $container,
99+
public function __construct(
100+
Container $container,
100101
callable $userResolver,
101102
array $abilities = [],
102103
array $policies = [],
103104
array $beforeCallbacks = [],
104105
array $afterCallbacks = [],
105-
?callable $guessPolicyNamesUsingCallback = null)
106-
{
106+
?callable $guessPolicyNamesUsingCallback = null,
107+
) {
107108
$this->policies = $policies;
108109
$this->container = $container;
109110
$this->abilities = $abilities;

src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ class DatabaseTokenRepository implements TokenRepositoryInterface
6363
* @param int $throttle
6464
* @return void
6565
*/
66-
public function __construct(ConnectionInterface $connection, HasherContract $hasher,
67-
$table, $hashKey, $expires = 60,
68-
$throttle = 60)
69-
{
66+
public function __construct(
67+
ConnectionInterface $connection,
68+
HasherContract $hasher,
69+
$table,
70+
$hashKey,
71+
$expires = 60,
72+
$throttle = 60,
73+
) {
7074
$this->table = $table;
7175
$this->hasher = $hasher;
7276
$this->hashKey = $hashKey;

src/Illuminate/Auth/SessionGuard.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
128128
* @param bool $rehashOnLogin
129129
* @return void
130130
*/
131-
public function __construct($name,
132-
UserProvider $provider,
133-
Session $session,
134-
?Request $request = null,
135-
?Timebox $timebox = null,
136-
bool $rehashOnLogin = true)
137-
{
131+
public function __construct(
132+
$name,
133+
UserProvider $provider,
134+
Session $session,
135+
?Request $request = null,
136+
?Timebox $timebox = null,
137+
bool $rehashOnLogin = true,
138+
) {
138139
$this->name = $name;
139140
$this->session = $session;
140141
$this->request = $request;

src/Illuminate/Auth/TokenGuard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function __construct(
5454
Request $request,
5555
$inputKey = 'api_token',
5656
$storageKey = 'api_token',
57-
$hash = false)
58-
{
57+
$hash = false,
58+
) {
5959
$this->hash = $hash;
6060
$this->request = $request;
6161
$this->provider = $provider;

src/Illuminate/Bus/Batch.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,20 @@ class Batch implements Arrayable, JsonSerializable
115115
* @param \Carbon\CarbonImmutable|null $finishedAt
116116
* @return void
117117
*/
118-
public function __construct(QueueFactory $queue,
119-
BatchRepository $repository,
120-
string $id,
121-
string $name,
122-
int $totalJobs,
123-
int $pendingJobs,
124-
int $failedJobs,
125-
array $failedJobIds,
126-
array $options,
127-
CarbonImmutable $createdAt,
128-
?CarbonImmutable $cancelledAt = null,
129-
?CarbonImmutable $finishedAt = null)
130-
{
118+
public function __construct(
119+
QueueFactory $queue,
120+
BatchRepository $repository,
121+
string $id,
122+
string $name,
123+
int $totalJobs,
124+
int $pendingJobs,
125+
int $failedJobs,
126+
array $failedJobIds,
127+
array $options,
128+
CarbonImmutable $createdAt,
129+
?CarbonImmutable $cancelledAt = null,
130+
?CarbonImmutable $finishedAt = null,
131+
) {
131132
$this->queue = $queue;
132133
$this->repository = $repository;
133134
$this->id = $id;

src/Illuminate/Bus/DynamoBatchRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(
6868
string $applicationName,
6969
string $table,
7070
?int $ttl,
71-
?string $ttlAttribute
71+
?string $ttlAttribute,
7272
) {
7373
$this->factory = $factory;
7474
$this->dynamoDbClient = $dynamoDbClient;

src/Illuminate/Cache/DatabaseStore.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ class DatabaseStore implements LockProvider, Store
7676
* @param array $lockLottery
7777
* @return void
7878
*/
79-
public function __construct(ConnectionInterface $connection,
80-
$table,
81-
$prefix = '',
82-
$lockTable = 'cache_locks',
83-
$lockLottery = [2, 100],
84-
$defaultLockTimeoutInSeconds = 86400)
85-
{
79+
public function __construct(
80+
ConnectionInterface $connection,
81+
$table,
82+
$prefix = '',
83+
$lockTable = 'cache_locks',
84+
$lockLottery = [2, 100],
85+
$defaultLockTimeoutInSeconds = 86400,
86+
) {
8687
$this->table = $table;
8788
$this->prefix = $prefix;
8889
$this->connection = $connection;

src/Illuminate/Cache/DynamoDbStore.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ class DynamoDbStore implements LockProvider, Store
6868
* @param string $prefix
6969
* @return void
7070
*/
71-
public function __construct(DynamoDbClient $dynamo,
72-
$table,
73-
$keyAttribute = 'key',
74-
$valueAttribute = 'value',
75-
$expirationAttribute = 'expires_at',
76-
$prefix = '')
77-
{
71+
public function __construct(
72+
DynamoDbClient $dynamo,
73+
$table,
74+
$keyAttribute = 'key',
75+
$valueAttribute = 'value',
76+
$expirationAttribute = 'expires_at',
77+
$prefix = '',
78+
) {
7879
$this->table = $table;
7980
$this->dynamo = $dynamo;
8081
$this->keyAttribute = $keyAttribute;

src/Illuminate/Database/Eloquent/Factories/Factory.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,16 @@ abstract class Factory
133133
* @param \Illuminate\Support\Collection|null $recycle
134134
* @return void
135135
*/
136-
public function __construct($count = null,
137-
?Collection $states = null,
138-
?Collection $has = null,
139-
?Collection $for = null,
140-
?Collection $afterMaking = null,
141-
?Collection $afterCreating = null,
142-
$connection = null,
143-
?Collection $recycle = null)
144-
{
136+
public function __construct(
137+
$count = null,
138+
?Collection $states = null,
139+
?Collection $has = null,
140+
?Collection $for = null,
141+
?Collection $afterMaking = null,
142+
?Collection $afterCreating = null,
143+
$connection = null,
144+
?Collection $recycle = null,
145+
) {
145146
$this->count = $count;
146147
$this->states = $states ?? new Collection;
147148
$this->has = $has ?? new Collection;

src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,16 @@ class BelongsToMany extends Relation
151151
* @param string|null $relationName
152152
* @return void
153153
*/
154-
public function __construct(Builder $query, Model $parent, $table, $foreignPivotKey,
155-
$relatedPivotKey, $parentKey, $relatedKey, $relationName = null)
156-
{
154+
public function __construct(
155+
Builder $query,
156+
Model $parent,
157+
$table,
158+
$foreignPivotKey,
159+
$relatedPivotKey,
160+
$parentKey,
161+
$relatedKey,
162+
$relationName = null,
163+
) {
157164
$this->parentKey = $parentKey;
158165
$this->relatedKey = $relatedKey;
159166
$this->relationName = $relationName;

0 commit comments

Comments
 (0)