mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Add error checking directive and unit tests for it
This commit is contained in:
parent
d4654eb5cf
commit
0f14ad8ccf
5 changed files with 98 additions and 0 deletions
|
|
@ -751,4 +751,21 @@ class Template
|
|||
default: return $grant->$type ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a validation error exists for v2.
|
||||
*
|
||||
* @param ...$args
|
||||
* @return bool
|
||||
*/
|
||||
protected function _v2_errorExists(...$args): bool
|
||||
{
|
||||
$validator_id = \Context::get('XE_VALIDATOR_ID');
|
||||
$validator_message = \Context::get('XE_VALIDATOR_MESSAGE');
|
||||
if (empty($validator_id) || empty($validator_message))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return count($args) ? in_array((string)$validator_id, $args, true) : true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue