Exemple #1
0
 public function overloadGetStepStrategy(callable $next, AbstractObject $context)
 {
     $context->setReturn('result');
     return $this->stepStrategy;
 }
Exemple #2
0
 /**
  * @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();
 }