Rename validateArray to validateSchemaArray and specify the format in doc comment
[MAILPOET-4700]
This commit is contained in:
@@ -48,7 +48,7 @@ class ValidStepArgsRule implements WorkflowNodeVisitor {
|
||||
['properties' => [$property => $propertySchema]]
|
||||
);
|
||||
try {
|
||||
$this->validator->validateArray(
|
||||
$this->validator->validateSchemaArray(
|
||||
$schemaToValidate,
|
||||
$step->getArgs(),
|
||||
$property
|
||||
|
@@ -25,17 +25,18 @@ class Validator {
|
||||
* @return mixed
|
||||
*/
|
||||
public function validate(Schema $schema, $value, string $paramName = 'value') {
|
||||
return $this->validateArray($schema->toArray(), $value, $paramName);
|
||||
return $this->validateSchemaArray($schema->toArray(), $value, $paramName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strict validation & sanitization implementation.
|
||||
* It only coerces int to float (e.g. 5 to 5.0).
|
||||
*
|
||||
* @param array $schema. The array must follow the format, which is returned from Schema::toArray().
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function validateArray(array $schema, $value, string $paramName = 'value') {
|
||||
public function validateSchemaArray(array $schema, $value, string $paramName = 'value') {
|
||||
$result = $this->validateAndSanitizeValueFromSchema($value, $schema, $paramName);
|
||||
if ($result instanceof WP_Error) {
|
||||
throw ValidationException::createFromWpError($result);
|
||||
|
Reference in New Issue
Block a user