Skip to content

Commit

Permalink
Merge pull request #1360 from creative-commoners/pulls/7.0/validation…
Browse files Browse the repository at this point in the history
…-interface

API Update validate signature
  • Loading branch information
GuySartorelli authored Dec 17, 2024
2 parents 2efc5ea + 30738f0 commit 2159249
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 2159249

Please sign in to comment.