laravel-filesystem-oss icon indicating copy to clipboard operation
laravel-filesystem-oss copied to clipboard

php 8.1.8 环境下 SignatureTrait.php on line 28 Passing null to parameter #1 ($datetime) of type string is deprecated

Open zotopteam opened this issue 3 years ago • 0 comments

在php8.1下会产生警告

local.WARNING: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/picoding_dev/vendor/iidestiny/flysystem-oss/src/Traits/SignatureTrait.php on line 28

下面这段代码:

    public function gmt_iso8601($time)
    {
        // fix bug https://connect.console.aliyun.com/connect/detail/162632
        return (new \DateTime(null, new \DateTimeZone('UTC')))->setTimestamp($time)->format('Y-m-d\TH:i:s\Z');
    }

zotopteam avatar Sep 30 '22 07:09 zotopteam