Skip to content

Commit 4ca7517

Browse files
committed
Modernize: Generic/UnnecessaryHeredoc: use class constant for constant array
1 parent e749e95 commit 4ca7517

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Standards/Generic/Sniffs/Strings/UnnecessaryHeredocSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UnnecessaryHeredocSniff implements Sniff
2020
*
2121
* @var array<string>
2222
*/
23-
private $escapeChars = [
23+
private const ESCAPE_CHARS = [
2424
// Octal sequences.
2525
'\0',
2626
'\1',
@@ -111,7 +111,7 @@ public function process(File $phpcsFile, $stackPtr)
111111
$phpcsFile->recordMetric($stackPtr, 'Heredoc contains interpolation or expression', 'no');
112112

113113
// Check for escape sequences which aren't supported in nowdocs.
114-
foreach ($this->escapeChars as $testChar) {
114+
foreach (self::ESCAPE_CHARS as $testChar) {
115115
if (strpos($body, $testChar) !== false) {
116116
return;
117117
}

0 commit comments

Comments
 (0)