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

Breadcrumb

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

function RequireTernaryOperatorSniff::containsLogicalOperators

2 calls to RequireTernaryOperatorSniff::containsLogicalOperators()
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 255

Class

RequireTernaryOperatorSniff

Namespace

SlevomatCodingStandard\Sniffs\ControlStructures

Code

private function containsLogicalOperators(File $phpcsFile, int $scopeOwnerPointer) : bool {
    $tokens = $phpcsFile->getTokens();
    return TokenHelper::findNext($phpcsFile, [
        T_LOGICAL_AND,
        T_LOGICAL_OR,
        T_LOGICAL_XOR,
    ], $tokens[$scopeOwnerPointer]['parenthesis_opener'] + 1, $tokens[$scopeOwnerPointer]['parenthesis_closer']) !== null;
}

API Navigation

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