code: public function isHeaderComment(Tokens $tokens, $index)
      {
          if (!$tokens[$index]->isGivenKind([T_COMMENT, T_DOC_COMMENT])) {
              throw new \InvalidArgumentException('Given index must point to a comment.');
          }
  
          $prevIndex = $tokens->getPrevMeaningfulToken($index);
  
          return $tokens[$prevIndex]->isGivenKind(T_OPEN_TAG) && null !== $tokens->getNextMeaningfulToken($index);
      }
docs: @param Tokens $tokens
  @param int    $index
  
  @return bool