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

Breadcrumb

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

function Helpers::normalizeVarName

*

Parameters

string $varName: * * @return string

4 calls to Helpers::normalizeVarName()
Helpers::findVariableScope in vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php
*
Helpers::getVariablesDefinedByArrowFunction in vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php
*
VariableAnalysisSniff::processVariable in vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
* Process a normal variable in the code. * * Most importantly, this function determines if the variable use is a "read" * (using the variable for something) or a "write" (an assignment) or, * sometimes, both at once. * …
VariableAnalysisSniff::processVariableInString in vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
* Called to process variables found in double quoted strings. * * Note that there may be more than one variable in the string, which will * result only in one call for the string. * *

File

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

Class

Helpers

Namespace

VariableAnalysis\Lib

Code

public static function normalizeVarName($varName) {
    $result = preg_replace('/[{}$]/', '', $varName);
    return $result ? $result : $varName;
}

API Navigation

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