Skip to content

Commit dbfaa91

Browse files
committed
Replace if with ??=
1 parent 19b5b96 commit dbfaa91

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/framework/src/Framework/Features/Publications/Models/PublicationField.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public function getValidationRules(?PublicationType $publicationType = null): Co
8383
/** @param \Hyde\Framework\Features\Publications\Models\PublicationType|null $publicationType Required only when using the 'image' type. */
8484
public function validate(mixed $input = null, Collection $fieldRules = null, ?PublicationType $publicationType = null): array
8585
{
86-
if (! $fieldRules) {
87-
$fieldRules = $this->getValidationRules($publicationType);
88-
}
86+
$fieldRules ??= $this->getValidationRules($publicationType);
8987

9088
$validator = validator([$this->name => $input], [$this->name => $fieldRules->toArray()]);
9189

0 commit comments

Comments
 (0)