previousLineContent) !== 0; $this->previousLineContent = $lineContent; $error = 'Constants are not allowed as the first argument of translation function, use string literal instead'; $constantRegexp = '[^\'"]+::[A-Z_0-9]+.*'; if ($currentLineMatch) { $variableRegexp = "~__\({$constantRegexp}\)|Phrase\({$constantRegexp}\)~"; if (preg_match($variableRegexp, $lineContent) !== 0) { $phpcsFile->addError($error, $stackPtr, 'VariableTranslation'); } } else if ($previousLineMatch) { $variableRegexp = "~^\s+{$constantRegexp}~"; if (preg_match($variableRegexp, $lineContent) !== 0) { $phpcsFile->addError($error, $stackPtr, 'VariableTranslation'); } } } }