Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Update validate signature #1360

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading