Skip to content

Commit

Permalink
Use shorthand nullability typings for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij committed Dec 16, 2024
1 parent c09e3f3 commit af9feb4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ThemeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ThemeServiceProvider extends ServiceProvider
protected string $packageName = 'theme-name';
protected array $commands = [];
protected bool $theme = true;
protected null|string $componentsNamespace = null;
protected ?string $componentsNamespace = null;

/**
* -------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/app/Http/Controllers/Auth/VerifyEmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class VerifyEmailController extends Controller
{
public null|string $redirectTo = null;
public ?string $redirectTo = null;

/**
* Create a new controller instance.
Expand Down
2 changes: 1 addition & 1 deletion src/app/Library/CrudPanel/Traits/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function filters()

/**
* @param string $name
* @return null|CrudFilter
* @return ?CrudFilter
*/
public function getFilter($name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/Library/CrudPanel/Traits/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ trait Input
* Returns the direct inputs parsed for model and relationship creation.
*
* @param array $inputs
* @param null|array $relationDetails
* @param ?array $relationDetails
* @param bool|string $relationMethod
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion src/app/Library/Uploaders/Support/RegisterUploadEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
}
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait HandleRepeatableUploads
{
public bool $handleRepeatableFiles = false;

public null|string $repeatableContainerName = null;
public ?string $repeatableContainerName = null;

/*******************************
* Setters - fluently configure the uploader
Expand All @@ -31,7 +31,7 @@ public function repeats(string $repeatableContainerName): self
/*******************************
* Getters
*******************************/
public function getRepeatableContainerName(): null|string
public function getRepeatableContainerName(): ?string
{
return $this->repeatableContainerName;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Library/Validation/Rules/ValidFileArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function validateItems(string $attribute, array $items, Closure $fail)
}
}

protected function validateArrayData(string $attribute, Closure $fail, null|array $data = null, null|array $rules = null): void
protected function validateArrayData(string $attribute, Closure $fail, ?array $data = null, ?array $rules = null): void
{
$data = $data ?? $this->data;
$rules = $rules ?? $this->getFieldRules();
Expand Down

0 comments on commit af9feb4

Please sign in to comment.