code: private function nextElementAcceptsDoctrineAnnotations(PhpTokens $tokens, $index)
      {
          do {
              $index = $tokens->getNextMeaningfulToken($index);
  
              if (null === $index) {
                  return false;
              }
          } while ($tokens[$index]->isGivenKind([T_ABSTRACT, T_FINAL]));
  
          if ($tokens[$index]->isClassy()) {
              return true;
          }
  
          while ($tokens[$index]->isGivenKind([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT])) {
              $index = $tokens->getNextMeaningfulToken($index);
          }
  
          return isset($this->classyElements[$index]);
      }
docs: @param PhpTokens $tokens
  @param int       $index
  
  @return bool