code: private function isUsingTrait(Tokens $tokens, $classIndex, $classOpenIndex, $classCloseIndex)
      {
          if ($tokens[$classIndex]->isGivenKind(T_INTERFACE)) {
              // cannot use Trait inside an interface
              return false;
          }
  
          $useIndex = $tokens->getNextTokenOfKind($classOpenIndex, [[CT::T_USE_TRAIT]]);
  
          return null !== $useIndex && $useIndex < $classCloseIndex;
      }
docs: @param Tokens $tokens
  @param int    $classIndex
  @param int    $classOpenIndex
  @param int    $classCloseIndex
  
  @return bool