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

Breadcrumb

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

function YodaHelper::getStopTokenCodes

*

Return value

array<int|string, bool>

2 calls to YodaHelper::getStopTokenCodes()
YodaHelper::getLeftSideTokens in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php
*
YodaHelper::getRightSideTokens in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php
*

File

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

Class

YodaHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

private static function getStopTokenCodes() : array {
    static $stopTokenCodes;
    if ($stopTokenCodes === null) {
        $stopTokenCodes = [
            T_BOOLEAN_AND => true,
            T_BOOLEAN_OR => true,
            T_SEMICOLON => true,
            T_OPEN_TAG => true,
            T_INLINE_THEN => true,
            T_INLINE_ELSE => true,
            T_LOGICAL_AND => true,
            T_LOGICAL_OR => true,
            T_LOGICAL_XOR => true,
            T_COALESCE => true,
            T_CASE => true,
            T_COLON => true,
            T_RETURN => true,
            T_COMMA => true,
            T_CLOSE_CURLY_BRACKET => true,
            T_MATCH_ARROW => true,
            T_FN_ARROW => true,
        ];
        $stopTokenCodes += array_fill_keys(array_keys(Tokens::$assignmentTokens), true);
        $stopTokenCodes += array_fill_keys(array_keys(Tokens::$commentTokens), true);
    }
    return $stopTokenCodes;
}

API Navigation

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