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

Breadcrumb

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

function Helpers::areFollowingArgumentsUsed

*

Parameters

VariableInfo $varInfo: * @param ScopeInfo $scopeInfo * * @return bool

1 call to Helpers::areFollowingArgumentsUsed()
VariableAnalysisSniff::processScopeCloseForVariable in vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
* Warn about an unused variable if it has not been used within a scope. * *

File

vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php, line 1221

Class

Helpers

Namespace

VariableAnalysis\Lib

Code

public static function areFollowingArgumentsUsed(VariableInfo $varInfo, ScopeInfo $scopeInfo) {
    $foundVarPosition = false;
    foreach ($scopeInfo->variables as $variable) {
        if ($variable === $varInfo) {
            $foundVarPosition = true;
            continue;
        }
        if (!$foundVarPosition) {
            continue;
        }
        if ($variable->scopeType !== ScopeType::PARAM) {
            continue;
        }
        if ($variable->firstRead) {
            return true;
        }
    }
    return false;
}

API Navigation

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