Skip to content

Commit 3786b51

Browse files
authored
use single indent for multiline ternarys (#54971)
this continues on some of my earlier formatting changes. you can read #53748 for my arguments why single indent is better.
1 parent c199db1 commit 3786b51

File tree

161 files changed

+505
-491
lines changed

Some content is hidden

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

161 files changed

+505
-491
lines changed

src/Illuminate/Auth/Access/Gate.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ protected function authorizeOnDemand($condition, $message, $code, $allowWhenResp
180180

181181
if ($condition instanceof Closure) {
182182
$response = $this->canBeCalledWithUser($user, $condition)
183-
? $condition($user)
184-
: new Response(false, $message, $code);
183+
? $condition($user)
184+
: new Response(false, $message, $code);
185185
} else {
186186
$response = $condition;
187187
}
@@ -277,8 +277,8 @@ protected function buildAbilityCallback($ability, $callback)
277277
}
278278

279279
return isset($method)
280-
? $policy->{$method}(...func_get_args())
281-
: $policy(...func_get_args());
280+
? $policy->{$method}(...func_get_args())
281+
: $policy(...func_get_args());
282282
};
283283
}
284284

src/Illuminate/Auth/DatabaseUserProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
7474
);
7575

7676
return $user && $user->getRememberToken() && hash_equals($user->getRememberToken(), $token)
77-
? $user : null;
77+
? $user
78+
: null;
7879
}
7980

8081
/**

src/Illuminate/Auth/EloquentUserProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ public function rehashPasswordIfRequired(UserContract $user, #[\SensitiveParamet
189189
protected function newModelQuery($model = null)
190190
{
191191
$query = is_null($model)
192-
? $this->createModel()->newQuery()
193-
: $model->newQuery();
192+
? $this->createModel()->newQuery()
193+
: $model->newQuery();
194194

195195
with($query, $this->queryCallback);
196196

src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function handle($request, Closure $next, $redirectToRoute = null)
3434
($request->user() instanceof MustVerifyEmail &&
3535
! $request->user()->hasVerifiedEmail())) {
3636
return $request->expectsJson()
37-
? abort(403, 'Your email address is not verified.')
38-
: Redirect::guest(URL::route($redirectToRoute ?: 'verification.notice'));
37+
? abort(403, 'Your email address is not verified.')
38+
: Redirect::guest(URL::route($redirectToRoute ?: 'verification.notice'));
3939
}
4040

4141
return $next($request);

src/Illuminate/Auth/SessionGuard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ public function id()
239239
}
240240

241241
return $this->user()
242-
? $this->user()->getAuthIdentifier()
243-
: $this->session->get($this->getName());
242+
? $this->user()->getAuthIdentifier()
243+
: $this->session->get($this->getName());
244244
}
245245

246246
/**

src/Illuminate/Broadcasting/BroadcastController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public function authenticateUser(Request $request)
4141
}
4242

4343
return Broadcast::resolveAuthenticatedUser($request)
44-
?? throw new AccessDeniedHttpException;
44+
?? throw new AccessDeniedHttpException;
4545
}
4646
}

src/Illuminate/Broadcasting/BroadcastEvent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct($event)
7575
public function handle(BroadcastingFactory $manager)
7676
{
7777
$name = method_exists($this->event, 'broadcastAs')
78-
? $this->event->broadcastAs() : get_class($this->event);
78+
? $this->event->broadcastAs() : get_class($this->event);
7979

8080
$channels = Arr::wrap($this->event->broadcastOn());
8181

@@ -84,8 +84,8 @@ public function handle(BroadcastingFactory $manager)
8484
}
8585

8686
$connections = method_exists($this->event, 'broadcastConnections')
87-
? $this->event->broadcastConnections()
88-
: [null];
87+
? $this->event->broadcastConnections()
88+
: [null];
8989

9090
$payload = $this->getPayloadFromEvent($this->event);
9191

src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function validAuthenticationResponse($request, $result)
7878
$user = $this->retrieveUser($request, $channelName);
7979

8080
$broadcastIdentifier = method_exists($user, 'getAuthIdentifierForBroadcasting')
81-
? $user->getAuthIdentifierForBroadcasting()
82-
: $user->getAuthIdentifier();
81+
? $user->getAuthIdentifierForBroadcasting()
82+
: $user->getAuthIdentifier();
8383

8484
$signature = $this->generateAblySignature(
8585
$request->channel_name,
@@ -175,8 +175,8 @@ public function normalizeChannelName($channel)
175175
{
176176
if ($this->isGuardedChannel($channel)) {
177177
return str_starts_with($channel, 'private-')
178-
? Str::replaceFirst('private-', '', $channel)
179-
: Str::replaceFirst('presence-', '', $channel);
178+
? Str::replaceFirst('private-', '', $channel)
179+
: Str::replaceFirst('presence-', '', $channel);
180180
}
181181

182182
return $channel;

src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ protected function binder()
299299
{
300300
if (! $this->bindingRegistrar) {
301301
$this->bindingRegistrar = Container::getInstance()->bound(BindingRegistrar::class)
302-
? Container::getInstance()->make(BindingRegistrar::class) : null;
302+
? Container::getInstance()->make(BindingRegistrar::class)
303+
: null;
303304
}
304305

305306
return $this->bindingRegistrar;

src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function validAuthenticationResponse($request, $result)
110110
$user = $this->retrieveUser($request, $channelName);
111111

112112
$broadcastIdentifier = method_exists($user, 'getAuthIdentifierForBroadcasting')
113-
? $user->getAuthIdentifierForBroadcasting()
114-
: $user->getAuthIdentifier();
113+
? $user->getAuthIdentifierForBroadcasting()
114+
: $user->getAuthIdentifier();
115115

116116
return $this->decodePusherResponse(
117117
$request,

0 commit comments

Comments
 (0)