Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RequireTernaryOperatorSniff.php

function RequireTernaryOperatorSniff::containsComment

2 calls to RequireTernaryOperatorSniff::containsComment()
RequireTernaryOperatorSniff::checkIfWithAssignments in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php
RequireTernaryOperatorSniff::checkIfWithReturns in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php, line 244

Class

RequireTernaryOperatorSniff

Namespace

SlevomatCodingStandard\Sniffs\ControlStructures

Code

private function containsComment(File $phpcsFile, int $scopeOwnerPointer) : bool {
    $tokens = $phpcsFile->getTokens();
    return TokenHelper::findNext($phpcsFile, Tokens::$commentTokens, $tokens[$scopeOwnerPointer]['scope_opener'] + 1, $tokens[$scopeOwnerPointer]['scope_closer']) !== null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal