/** * Find in context inner directive with identical name and value * @param $directiveName * @param $value * @param iContext $context * @return iDirective|null if exists return it or return null */ protected function getInnerDirectiveIfExists($directiveName, $value, iContext $context) { foreach ($context->getInnerDirectives() as $innerDirective) { if ($innerDirective->getName() == $directiveName and $innerDirective->getValue() == $value) { return $innerDirective; } } return null; }