Skip to content

Commit f07e5be

Browse files
committed
WIP
1 parent ad0050e commit f07e5be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

php/php-codesniffer-standard/VIISON/Sniffs/Strings/DateMethodsInSqlSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
use PHP_CodeSniffer\Files\File;
55
use PHP_CodeSniffer\Sniffs\Sniff;
66

7-
// phpcs:disable VIISON.Strings.DateMethodsInSqlSniff.NoNow
8-
// phpcs:disable VIISON.Strings.DateMethodsInSqlSniff.NoCurrentTimestamp
7+
// phpcs:disable VIISON.Strings.DateMethodsInSql.NoNow
8+
// phpcs:disable VIISON.Strings.DateMethodsInSql.NoCurrentTimestamp
99

1010
/**
1111
* This sniff disallows the usage of the method NOW() and CURRENT_TIMESTAMP() in SQL queries as they have weird
@@ -33,12 +33,12 @@ public function process(File $phpcsFile, $stackPtr)
3333
$token = $phpcsFile->getTokens()[$stackPtr];
3434
$content = $token['content'];
3535

36-
if (stripos($content, 'NOW(') !== false) {
36+
if (mb_stripos($content, 'NOW(') !== false) {
3737
$error = 'The usage of the method NOW() in SQL queries is not allowed. Use UTC_TIMESTAMP() instead.';
3838
$phpcsFile->addError($error, $stackPtr, 'NoNow');
3939
}
4040

41-
if (stripos($content, 'CURRENT_TIMESTAMP(') !== false) {
41+
if (mb_stripos($content, 'CURRENT_TIMESTAMP(') !== false) {
4242
$error = 'The usage of the method CURRENT_TIMESTAMP() in SQL queries is not allowed. Use UTC_TIMESTAMP() instead.';
4343
$phpcsFile->addError($error, $stackPtr, 'NoCurrentTimestamp');
4444
}

0 commit comments

Comments
 (0)