public function overloadGetStepStrategy(callable $next, AbstractObject $context) { $context->setReturn('result'); return $this->stepStrategy; }
/** * @param AbstractObject $context * * @return int|string */ public function overloadGetIndex(callable $next, AbstractObject $context) { $element = $context->getElement(); if (!$element->getParent()) { $context->setReturn(null); } else { foreach ($element->getParent()->getChildren() as $i => $child) { if ($child === $element) { return $i; } } } return $next(); }