61 $this->
match = (string) $node[
'match'];
62 if (empty($this->
match)) {
65 foreach ($node->attributes() as $name => $value) {
66 if (
'match' !== $name) {
70 foreach ($node->children() as $child) {
79 public function render($data, $citationNumber =
null)
83 foreach ($this->children as $child) {
84 $ret[] = $child->render($data, $citationNumber);
87 $parent = $this->parent->getParent();
89 $glue =
$parent->getDelimiter();
91 return implode($glue, $ret);
98 public function match($data, $citationNumber =
null)
100 if ($this->constraints->count() === 1) {
101 return $this->constraints->current()->validate($data);
105 foreach ($this->constraints as $constraint) {
106 if ($this->
match ===
"any") {
107 if ($constraint->validate($data, $citationNumber)) {
111 $result &= $constraint->validate($data, $citationNumber);
114 if ($this->constraints->count() > 1 && $this->match ===
"all") {
115 return (
bool) $result;
116 } elseif ($this->
match ===
"none") {
117 return !((bool) $result);