Skip to content

Commit 904b31e

Browse files
committed
Use shorthand nullability typings in docblocks for better readability
1 parent bdb0183 commit 904b31e

17 files changed

+24
-24
lines changed

src/app/Console/Commands/PublishBackpackMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function getStub()
3333
/**
3434
* Execute the console command.
3535
*
36-
* @return bool|null
36+
* @return ?bool
3737
*/
3838
public function handle()
3939
{

src/app/Http/Controllers/Auth/ResetPasswordController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct()
6666
* If no token is present, display the link request form.
6767
*
6868
* @param \Illuminate\Http\Request $request
69-
* @param string|null $token
69+
* @param ?string $token
7070
* @return \Illuminate\Contracts\View\View
7171
*/
7272
public function showResetForm(Request $request, $token = null)

src/app/Http/Middleware/CheckIfAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CheckIfAdmin
2222
* does not have a '/home' route, use something you've built for your users
2323
* (again - users, not admins).
2424
*
25-
* @param \Illuminate\Contracts\Auth\Authenticatable|null $user
25+
* @param ?\Illuminate\Contracts\Auth\Authenticatable $user
2626
* @return bool
2727
*/
2828
private function checkIfUserIsAdmin($user)

src/app/Http/Middleware/ThrottlePasswordRecovery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ThrottlePasswordRecovery extends ThrottleRequests
1313
* @param \Illuminate\Http\Request $request
1414
* @param string $key
1515
* @param int $maxAttempts
16-
* @param callable|null $responseCallback
16+
* @param ?callable $responseCallback
1717
* @return \Illuminate\Validation\ValidationException
1818
*/
1919
protected function buildException($request, $key, $maxAttempts, $responseCallback = null)

src/app/Http/Middleware/UseBackpackAuthGuardInsteadOfDefaultAuthGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class UseBackpackAuthGuardInsteadOfDefaultAuthGuard
1111
*
1212
* @param \Illuminate\Http\Request $request
1313
* @param \Closure $next
14-
* @param string|null $guard
14+
* @param ?string $guard
1515
* @return mixed
1616
*/
1717
public function handle($request, Closure $next, $guard = null)

src/app/Library/Auth/ResetsPasswords.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait ResetsPasswords
2121
* If no token is present, display the link request form.
2222
*
2323
* @param \Illuminate\Http\Request $request
24-
* @param string|null $token
24+
* @param ?string $token
2525
* @return \Illuminate\Contracts\View\View
2626
*/
2727
public function showResetForm(Request $request, $token = null)

src/app/Library/CrudPanel/CrudButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function section($stack)
294294
* Get the end result that should be displayed to the user.
295295
* The HTML itself of the button.
296296
*
297-
* @param object|null $entry The eloquent Model for the current entry or null if no current entry.
297+
* @param ?object $entry The eloquent Model for the current entry or null if no current entry.
298298
* @return \Illuminate\Contracts\View\View
299299
*/
300300
public function getHtml($entry = null)

src/app/Library/CrudPanel/CrudField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public function validationMessages(array $messages)
299299
* ->addMorphOption('App\Models\Model', 'label', ['data_source' => backpack_url('smt')]).
300300
*
301301
* @param string $key - the morph option key, usually a \Model\Class or a string for the morphMap
302-
* @param string|null $label - the displayed text for this option
302+
* @param ?string $label - the displayed text for this option
303303
* @param array $options - options for the corresponding morphable_id field (usually ajax options)
304304
* @return self
305305
*

src/app/Library/CrudPanel/Traits/Buttons.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function buttons()
112112
public function modifyButton($name, $modifications = null)
113113
{
114114
/**
115-
* @var CrudButton|null
115+
* @var ?CrudButton
116116
*/
117117
$button = $this->buttons()->firstWhere('name', $name);
118118

@@ -144,7 +144,7 @@ public function removeButton($name, $stack = null)
144144

145145
/**
146146
* @param array $names Button names
147-
* @param string|null $stack Optional stack name.
147+
* @param ?string $stack Optional stack name.
148148
*/
149149
public function removeButtons($names, $stack = null)
150150
{

src/app/Library/CrudPanel/Traits/Create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function getRelationFields($fields = [])
9999
*
100100
* @param Model $item The current CRUD model.
101101
* @param array $formattedRelations The form data.
102-
* @return bool|null
102+
* @return ?bool
103103
*/
104104
private function createRelationsForItem($item, $formattedRelations)
105105
{
@@ -220,7 +220,7 @@ private function preparePivotAttributesForSave(array $attributes, BelongsToMany|
220220
* 'attribute' => 'passport',
221221
* 'values' => **THE TRICKY BIT**,
222222
* ]
223-
* @return Model|null
223+
* @return ?Model
224224
*/
225225
private function createUpdateOrDeleteOneToOneRelation($relation, $relationMethod, $relationDetails)
226226
{

0 commit comments

Comments
 (0)