1 <?php declare(strict_types=1);
14 abstract protected function getError();
33 $error = $this->getError();
34 if (!is_callable($error)) {
35 return (
string) $error;
38 return call_user_func($this->error, $lng_closure, $value);
50 $args = func_get_args();
51 if (count($args) < 1) {
52 throw new \InvalidArgumentException(
53 "Expected an id of a lang var as first parameter" 56 $error = $this->lng->txt($args[0]);
57 if (count($args) > 1) {
59 for (
$i = 0;
$i < count($args);
$i++) {
61 if ((is_array($v) || is_object($v) || is_null($v))
62 && !method_exists($v,
"__toString")) {
65 } elseif (is_null($v)) {
68 $args[
$i] = get_class($v);
72 $error = call_user_func_array(
"sprintf", $args);
getLngClosure()
Get the closure to be passed to the error-function that does i18n and sprintf.
withProblemBuilder(callable $builder)
getErrorMessage($value)
Get the problem message.