Skip to content

Commit

Permalink
Replace if with ??=
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 22, 2022
1 parent 19b5b96 commit dbfaa91
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public function getValidationRules(?PublicationType $publicationType = null): Co
/** @param \Hyde\Framework\Features\Publications\Models\PublicationType|null $publicationType Required only when using the 'image' type. */
public function validate(mixed $input = null, Collection $fieldRules = null, ?PublicationType $publicationType = null): array
{
if (! $fieldRules) {
$fieldRules = $this->getValidationRules($publicationType);
}
$fieldRules ??= $this->getValidationRules($publicationType);

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

Expand Down

0 comments on commit dbfaa91

Please sign in to comment.