Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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を導入した

yugi-a
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away