From d960972028bd756cc59c8a9bbe94ff5a76e83a4e Mon Sep 17 00:00:00 2001 From: divinity76 Date: Sun, 17 Mar 2024 15:28:43 +0100 Subject: [PATCH] PHP8.3 compatibility strftime was deprecated in PHP8.1.0. This is the only PHP8.3.0 compatibility issue detected by the PHPCompatibility scanner git version right now: hans@DESKTOP-EE15SLU:~/projects/PHPCompatibility$ ./vendor/bin/phpcs ../wrench/ --standard=PHPCompatibility FILE: /home/hans/projects/wrench/examples/StatusApplication.php -------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------- 112 | WARNING | Function strftime() is deprecated since PHP 8.1; Use date() or IntlDateFormatter::format() instead -------------------------------------------------------------------------------------------------------------------- Time: 710ms; Memory: 16MB Related: https://github.com/chrome-php/wrench/pull/14 and https://github.com/chrome-php/chrome/issues/605 --- examples/StatusApplication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/StatusApplication.php b/examples/StatusApplication.php index 4a25252..4a2f935 100644 --- a/examples/StatusApplication.php +++ b/examples/StatusApplication.php @@ -109,7 +109,7 @@ public function statusMsg($text, $type = 'info'): void { $data = [ 'type' => $type, - 'text' => '['.\strftime('%m-%d %H:%M', \time()).'] '.$text, + 'text' => '['.\date('m-d H:i', \time()).'] '.$text, ]; $encodedData = $this->_encodeData('statusMsg', $data);