Skip to content

Commit 340cb31

Browse files
committed
Coding-Standard-Tutorial: update code sample
... to prevent a deprecation notice on PHP 7.4 and a parse error on PHP 8.0+. Fixes PHPCSStandards/PHP_CodeSniffer#496
1 parent 10afb97 commit 340cb31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wiki/Coding-Standard-Tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class DisallowHashCommentsSniff implements Sniff
109109
public function process(File $phpcsFile, $stackPtr)
110110
{
111111
$tokens = $phpcsFile->getTokens();
112-
if ($tokens[$stackPtr]['content']{0} === '#') {
112+
if ($tokens[$stackPtr]['content'][0] === '#') {
113113
$error = 'Hash comments are prohibited; found %s';
114114
$data = array(trim($tokens[$stackPtr]['content']));
115115
$phpcsFile->addError($error, $stackPtr, 'Found', $data);

0 commit comments

Comments
 (0)