improved error reporting
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user