Skip to content

Commit

Permalink
Add PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 31, 2022
1 parent 3bc9ebb commit 58351ea
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,22 @@ protected static function parseError(string $input): InvalidArgumentException
return new InvalidArgumentException("$className: Unable to parse invalid $typeName value '$input'");
}

/**
* Get the validation rules that apply to the field.
*
* @param \Hyde\Framework\Features\Publications\Models\PublicationFieldDefinition|null $fieldDefinition
* @return array<string>
*/
public function getRules(?PublicationFieldDefinition $fieldDefinition = null): array
{
return $fieldDefinition?->getValidationRules() ?? static::rules();
}

/**
* Get the default validation rules for this field type.
*
* @return array<string>
*/
public static function rules(): array
{
return [];
Expand Down

0 comments on commit 58351ea

Please sign in to comment.