Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
windaishi committed Nov 28, 2024
1 parent 247569d commit fb5bcce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -34,12 +34,12 @@ public function process(File $phpcsFile, $stackPtr)
$content = $token['content'];

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

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

0 comments on commit fb5bcce

Please sign in to comment.