/**
  * @param $definition
  * @param ReflectionClass $context
  * @return ReflectionConstant|ReflectionMethod|ReflectionProperty|NULL
  */
 private function resolveIfInContext($definition, ReflectionClass $context)
 {
     $definition = $this->removeEndBrackets($definition);
     $definition = $this->removeStartDollar($definition);
     if ($context->hasProperty($definition)) {
         return $context->getProperty($definition);
     } elseif ($context->hasMethod($definition)) {
         return $context->getMethod($definition);
     } elseif ($context->hasConstant($definition)) {
         return $context->getConstant($definition);
     }
     return NULL;
 }