Skip to content

Commit 87f001f

Browse files
committed
Add nowdoc tokens to list of valid tokens in a static variable declaration.
1 parent 6bd2c0b commit 87f001f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sniffs/CodeAnalysis/VariableAnalysisSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ protected function checkForStaticDeclaration(
991991
// number T_MINUS T_LNUMBER T_DNUMBER
992992
// string T_CONSTANT_ENCAPSED_STRING
993993
// heredoc T_START_HEREDOC T_HEREDOC T_END_HEREDOC
994+
// nowdoc T_START_NOWDOC T_NOWDOC T_END_NOWDOC
994995
// define T_STRING
995996
// class constant T_STRING T_DOUBLE_COLON T_STRING
996997
// Search backwards for first token that isn't whitespace, comma, variable,
@@ -1003,6 +1004,7 @@ protected function checkForStaticDeclaration(
10031004
T_STRING,
10041005
T_DOUBLE_COLON,
10051006
T_START_HEREDOC, T_HEREDOC, T_END_HEREDOC,
1007+
T_START_NOWDOC, T_NOWDOC, T_END_NOWDOC,
10061008
),
10071009
$stackPtr - 1, null, true, null, true);
10081010
if (($staticPtr === false) || ($tokens[$staticPtr]['code'] !== T_STATIC)) {

0 commit comments

Comments
 (0)