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\HelpersCode
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;
}