Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit a4bdee9

Browse files
Merge branch '1.0.2'
2 parents bba0ce5 + 887fa9a commit a4bdee9

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
<?php
2-
/** Just a test to confirm the coding standard is loaded */
3-
4-
use PHP_CodeSniffer\Sniffs\Sniff;
5-
use PHP_CodeSniffer\Files\File;
6-
7-
class SilentFallbackSniff implements Sniff
8-
{
9-
public function register()
10-
{
11-
return array(T_COMMENT);
12-
}
13-
14-
public function process(File $phpcsFile, $stackPtr)
15-
{
16-
$tokens = $phpcsFile->getTokens();
17-
if (substr( $tokens[$stackPtr]['content'], 0, 9 ) === '#neuralab') {
18-
$warn = 'Neuralab silent linter is working; found %s';
19-
$data = array(trim($tokens[$stackPtr]['content']));
20-
$phpcsFile->addWarning($warn, $stackPtr, 'Found', $data);
21-
}
22-
}
23-
}
1+
<?php
2+
/** Just a test to confirm the coding standard is loaded */
3+
namespace NeuralabSilent\Sniffs\Test;
4+
5+
use PHP_CodeSniffer\Sniffs\Sniff;
6+
use PHP_CodeSniffer\Files\File;
7+
8+
class SilentFallbackSniff implements Sniff
9+
{
10+
public function register()
11+
{
12+
return array(T_COMMENT);
13+
}
14+
15+
public function process(File $phpcsFile, $stackPtr)
16+
{
17+
$tokens = $phpcsFile->getTokens();
18+
if (substr( $tokens[$stackPtr]['content'], 0, 9 ) === '#neuralab') {
19+
$warn = 'Neuralab silent linter is working; found %s';
20+
$data = array(trim($tokens[$stackPtr]['content']));
21+
$phpcsFile->addWarning($warn, $stackPtr, 'Found', $data);
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)