/** * {@inheritdoc} */ public function accept() { return $this->condition->matchItem($this->current()); }
/** * {@inheritdoc} */ public function describe() { return $this->condition ? 'item.parent(' . $this->condition->describe() . ')' : 'item.parent != null'; }
/** * {@inheritdoc} */ public function describe() { return sprintf('not %s', $this->condition->describe()); }
/** * {@inheritdoc} */ public function reduce(ConditionInterface $condition) { $item = $this->duplicate(false); $children = $item->getChildren(); foreach ($this->children as $child) { if ($condition->matchItem($child)) { $children->add($child->reduce($condition)); } } return $item; }