Skip to content

Commit

Permalink
PHP8.3 compatibility
Browse files Browse the repository at this point in the history
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: #14 and chrome-php/chrome#605
  • Loading branch information
divinity76 authored Mar 17, 2024
1 parent 2cf557f commit d960972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/StatusApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d960972

Please sign in to comment.