improved error reporting

This commit is contained in:
2021-06-21 23:33:02 +02:00
parent 95468c609d
commit 562ff50bb0
3 changed files with 92 additions and 44 deletions

View File

@ -24,4 +24,26 @@ final class CSVXMLValidator
$inv_errors = [];
$depcon_errors = [];
}
public function addError(String $error)
{
$this->error_msgs[] = $error;
}
public function addInvError(String $error)
{
$this->inv_errors[] = $error;
}
public function addDepconError(String $error)
{
$this->depcon_errors[] = $error;
}
public function overallErrorCount(): int
{
return count($this->error_msgs)
+ count($this->inv_errors)
+ count($this->depcon_errors);
}
}

View File

@ -21,12 +21,12 @@ final class FieldEntry
/**
* Function for constructing a new FieldEntry Object.
*
* @param bool $required True if the field is required.
* @param array $allowedValues Array of allowed values.
* @param array $dependsOn Array of fields the entry depends on.
* @param string $remark String variable.
* @param string $name_human_readable Human readable translation.
* @param string $explica String variable
* @param bool $required True if the field is required.
* @param array $allowedValues Array of allowed values.
* @param array $dependsOn Array of fields the entry depends on.
* @param string $remark String variable.
* @param string $name_human_readable Human readable translation.
* @param string $explica String variable
*/
public function __construct(
bool $required, array $allowedValues,