Skip to content

Commit af9feb4

Browse files
committed
Use shorthand nullability typings for better readability
1 parent c09e3f3 commit af9feb4

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/ThemeServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ThemeServiceProvider extends ServiceProvider
1414
protected string $packageName = 'theme-name';
1515
protected array $commands = [];
1616
protected bool $theme = true;
17-
protected null|string $componentsNamespace = null;
17+
protected ?string $componentsNamespace = null;
1818

1919
/**
2020
* -------------------------

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class VerifyEmailController extends Controller
1313
{
14-
public null|string $redirectTo = null;
14+
public ?string $redirectTo = null;
1515

1616
/**
1717
* Create a new controller instance.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function filters()
136136

137137
/**
138138
* @param string $name
139-
* @return null|CrudFilter
139+
* @return ?CrudFilter
140140
*/
141141
public function getFilter($name)
142142
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait Input
1717
* Returns the direct inputs parsed for model and relationship creation.
1818
*
1919
* @param array $inputs
20-
* @param null|array $relationDetails
20+
* @param ?array $relationDetails
2121
* @param bool|string $relationMethod
2222
* @return array
2323
*/

src/app/Library/Uploaders/Support/RegisterUploadEvents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
}
2626
}
2727

28-
public static function handle(CrudField|CrudColumn $crudObject, array $uploaderConfiguration, string $macro, ?array $subfield = null, ?bool $registerModelEvents = true): void
28+
public static function handle(CrudField|CrudColumn $crudObject, array $uploaderConfiguration, string $macro, ?array $subfield = null, bool $registerModelEvents = true): void
2929
{
3030
$instance = new self($crudObject, $uploaderConfiguration, $macro);
3131

src/app/Library/Uploaders/Support/Traits/HandleRepeatableUploads.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait HandleRepeatableUploads
1414
{
1515
public bool $handleRepeatableFiles = false;
1616

17-
public null|string $repeatableContainerName = null;
17+
public ?string $repeatableContainerName = null;
1818

1919
/*******************************
2020
* Setters - fluently configure the uploader
@@ -31,7 +31,7 @@ public function repeats(string $repeatableContainerName): self
3131
/*******************************
3232
* Getters
3333
*******************************/
34-
public function getRepeatableContainerName(): null|string
34+
public function getRepeatableContainerName(): ?string
3535
{
3636
return $this->repeatableContainerName;
3737
}

src/app/Library/Validation/Rules/ValidFileArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function validateItems(string $attribute, array $items, Closure $fail)
6363
}
6464
}
6565

66-
protected function validateArrayData(string $attribute, Closure $fail, null|array $data = null, null|array $rules = null): void
66+
protected function validateArrayData(string $attribute, Closure $fail, ?array $data = null, ?array $rules = null): void
6767
{
6868
$data = $data ?? $this->data;
6969
$rules = $rules ?? $this->getFieldRules();

0 commit comments

Comments
 (0)