Skip to content

Commit

Permalink
Merge branch '1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
SlobodanAlavanjaNeuralab committed Nov 15, 2024
2 parents bba0ce5 + 887fa9a commit a4bdee9
Showing 1 changed file with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<?php
/** Just a test to confirm the coding standard is loaded */

use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Files\File;

class SilentFallbackSniff implements Sniff
{
public function register()
{
return array(T_COMMENT);
}

public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (substr( $tokens[$stackPtr]['content'], 0, 9 ) === '#neuralab') {
$warn = 'Neuralab silent linter is working; found %s';
$data = array(trim($tokens[$stackPtr]['content']));
$phpcsFile->addWarning($warn, $stackPtr, 'Found', $data);
}
}
}
<?php
/** Just a test to confirm the coding standard is loaded */
namespace NeuralabSilent\Sniffs\Test;

use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Files\File;

class SilentFallbackSniff implements Sniff
{
public function register()
{
return array(T_COMMENT);
}

public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (substr( $tokens[$stackPtr]['content'], 0, 9 ) === '#neuralab') {
$warn = 'Neuralab silent linter is working; found %s';
$data = array(trim($tokens[$stackPtr]['content']));
$phpcsFile->addWarning($warn, $stackPtr, 'Found', $data);
}
}
}

0 comments on commit a4bdee9

Please sign in to comment.