0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHP 7.1 RC -> 7.1.26 バージョンアップで引っかかったメモ1

Posted at

PHPのバージョンを
7.1RCから7.1.26に上げた際に発生。

環境

PHP 7.1.26
CAKEPHP 3.3.4
Chronos 1.0.0

現象

下記ワーニングが出るようになった

Warning Error: Declaration of Cake\Chronos\Traits\FrozenTimeTrait::setTime($hours, $minutes, $seconds = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL) in [~~~~/vendor/cakephp/chronos/src/MutableDate.php, line 24]

内容
https://qiita.com/zaramme/items/33c3944c1057c1297b5a

対応

CAKEPHPで使用しているライブラリのChronosのバージョンを上げることで解決

下記箇所でPHP7.1対応されていた
https://github.com/cakephp/chronos/commit/38110a8029689e72bb2b8a1d7a908477dde01ad6#diff-1eaff23ec9450a4955844be872867b8f

7.1との互換性追加
https://github.com/cakephp/chronos/releases/tag/1.0.1

余談
Chronos1.0.1にアップデートすることでワーニングは出力されなくなったが、結果的に1.2.3を導入した

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?