Sends an error message to the collector for later use.
45 if (func_num_args() > 2) {
46 $args = func_get_args();
51 $token = $this->context->get(
'CurrentToken',
true);
52 $line = $token ? $token->line : $this->context->get(
'CurrentLine',
true);
53 $col = $token ? $token->col : $this->context->get(
'CurrentCol',
true);
54 $attr = $this->context->get(
'CurrentAttr',
true);
58 if (!is_null($token)) {
59 $args[
'CurrentToken'] = $token;
61 if (!is_null($attr)) {
62 $subst[
'$CurrentAttr.Name'] = $attr;
63 if (isset($token->attr[$attr])) $subst[
'$CurrentAttr.Value'] = $token->attr[$attr];
67 $msg = $this->locale->getMessage($msg);
69 $msg = $this->locale->formatMessage($msg, $args);
72 if (!empty($subst)) $msg = strtr($msg, $subst);
76 self::LINENO => $line,
77 self::SEVERITY => $severity,
78 self::MESSAGE => $msg,
79 self::CHILDREN => array()
81 $this->_current[] = $error;
92 if ($token) $new_struct->value = clone $token;
93 if (is_int($line) && is_int($col)) {
94 if (isset($this->lines[$line][$col])) {
95 $struct = $this->lines[$line][$col];
97 $struct = $this->lines[$line][$col] = $new_struct;
100 ksort($this->lines[$line], SORT_NUMERIC);
102 if (isset($this->lines[-1])) {
103 $struct = $this->lines[-1];
105 $struct = $this->lines[-1] = $new_struct;
108 ksort($this->lines, SORT_NUMERIC);
113 if (!$struct->value) {
114 $struct->value = array($attr,
'PUT VALUE HERE');
117 if (!empty($cssprop)) {
119 if (!$struct->value) {
121 $struct->value = array($cssprop,
'PUT VALUE HERE');
126 $struct->addError($severity, $msg);
Records errors for particular segments of an HTML document such as tokens, attributes or CSS properti...
const TOKEN
Possible values for $children first-key.