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

Breadcrumb

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

function YodaHelper::getTokenDynamism

*

Return value

array<int|string, int>

1 call to YodaHelper::getTokenDynamism()
YodaHelper::getDynamismForTokens in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php
*

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php, line 298

Class

YodaHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

private static function getTokenDynamism() : array {
    static $tokenDynamism;
    if ($tokenDynamism === null) {
        $tokenDynamism = [
            T_TRUE => 0,
            T_FALSE => 0,
            T_NULL => 0,
            T_DNUMBER => 0,
            T_LNUMBER => 0,
            T_OPEN_SHORT_ARRAY => 0,
            // Do not stack error messages when the old-style array syntax is used
T_ARRAY => 0,
            T_CONSTANT_ENCAPSED_STRING => 0,
            T_VARIABLE => self::DYNAMISM_VARIABLE,
            T_STRING => self::DYNAMISM_FUNCTION_CALL,
        ];
        $tokenDynamism += array_fill_keys(array_keys(Tokens::$castTokens), 3);
    }
    return $tokenDynamism;
}

API Navigation

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