From 30738f0dbe00b0a14d105e6c31cf4c1ab29b0f74 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 16 Dec 2024 19:23:53 +1300 Subject: [PATCH] API Update validate signature --- code/Model/EditableFormField/EditableFileField.php | 5 +---- code/Model/EditableFormField/EditableNumericField.php | 3 ++- code/Model/EditableFormField/EditableTextField.php | 5 +---- code/Model/Recipient/EmailRecipient.php | 4 +--- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/code/Model/EditableFormField/EditableFileField.php b/code/Model/EditableFormField/EditableFileField.php index da2ffd888..0b9c78286 100755 --- a/code/Model/EditableFormField/EditableFileField.php +++ b/code/Model/EditableFormField/EditableFileField.php @@ -179,10 +179,7 @@ public function getCMSFields() return parent::getCMSFields(); } - /** - * @return ValidationResult - */ - public function validate() + public function validate(): ValidationResult { $result = parent::validate(); diff --git a/code/Model/EditableFormField/EditableNumericField.php b/code/Model/EditableFormField/EditableNumericField.php index aa7548426..1cf6d592b 100755 --- a/code/Model/EditableFormField/EditableNumericField.php +++ b/code/Model/EditableFormField/EditableNumericField.php @@ -7,6 +7,7 @@ use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\NumericField; use SilverStripe\UserForms\Model\EditableFormField; +use SilverStripe\Core\Validation\ValidationResult; /** * EditableNumericField @@ -85,7 +86,7 @@ protected function updateFormField($field) } } - public function validate() + public function validate(): ValidationResult { $result = parent::validate(); if ($this->MinValue > $this->MaxValue) { diff --git a/code/Model/EditableFormField/EditableTextField.php b/code/Model/EditableFormField/EditableTextField.php index 09d33a846..dc8a3d0e7 100644 --- a/code/Model/EditableFormField/EditableTextField.php +++ b/code/Model/EditableFormField/EditableTextField.php @@ -105,10 +105,7 @@ public function getCMSFields() return parent::getCMSFields(); } - /** - * @return ValidationResult - */ - public function validate() + public function validate(): ValidationResult { $result = parent::validate(); diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index b7540b443..0d339b48d 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -603,10 +603,8 @@ public function getEmailTemplateDropdownValues() /** * Validate that valid email addresses are being used - * - * @return ValidationResult */ - public function validate() + public function validate(): ValidationResult { $result = parent::validate(); $checkEmail = [