Skip to content

Commit

Permalink
API Update validate signature
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 16, 2024
1 parent 2efc5ea commit 30738f0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
5 changes: 1 addition & 4 deletions code/Model/EditableFormField/EditableFileField.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@ public function getCMSFields()
return parent::getCMSFields();
}

/**
* @return ValidationResult
*/
public function validate()
public function validate(): ValidationResult
{
$result = parent::validate();

Expand Down
3 changes: 2 additions & 1 deletion code/Model/EditableFormField/EditableNumericField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\NumericField;
use SilverStripe\UserForms\Model\EditableFormField;
use SilverStripe\Core\Validation\ValidationResult;

/**
* EditableNumericField
Expand Down Expand Up @@ -85,7 +86,7 @@ protected function updateFormField($field)
}
}

public function validate()
public function validate(): ValidationResult
{
$result = parent::validate();
if ($this->MinValue > $this->MaxValue) {
Expand Down
5 changes: 1 addition & 4 deletions code/Model/EditableFormField/EditableTextField.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ public function getCMSFields()
return parent::getCMSFields();
}

/**
* @return ValidationResult
*/
public function validate()
public function validate(): ValidationResult
{
$result = parent::validate();

Expand Down
4 changes: 1 addition & 3 deletions code/Model/Recipient/EmailRecipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 30738f0

Please sign in to comment.