tencentyun / cos-php-sdk-v5

cos-php-sdk-v5
MIT License
181 stars 82 forks source link

PHP 8.1: Passing null to non-nullable internal function parameters is deprecated #261

Closed tianyiw2013 closed 2 years ago

tianyiw2013 commented 2 years ago

PHP 8.1: Passing null to non-nullable internal function parameters is deprecated

sy-records commented 2 years ago

https://github.com/guzzle/command/pull/45

tianyiw2013 commented 2 years ago

下面是另外一个兼容性问题,是上游guzzle-services的问题,这里引用一下PR:

https://github.com/guzzle/guzzle-services/pull/183

php8.1 传入Params时报错:http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated

$signedUrl = $cosClient->getObjectUrl(
        $bucket,
        $key,
        '+10 minutes', //签名的有效时间
        [
            'ResponseContentDisposition' => '111',
            'Params' => [ // Params中可以传自定义querystring
                'aaa' => 'bbb',
                'ccc' => 'ddd'
            ],
        ]
    );
tuuna commented 2 years ago

下面是另外一个兼容性问题,是上游guzzle-services的问题,这里引用一下PR:

guzzle/guzzle-services#183

php8.1 传入Params时报错:http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated

$signedUrl = $cosClient->getObjectUrl(
        $bucket,
        $key,
        '+10 minutes', //签名的有效时间
        [
            'ResponseContentDisposition' => '111',
            'Params' => [ // Params中可以传自定义querystring
                'aaa' => 'bbb',
                'ccc' => 'ddd'
            ],
        ]
    );

感谢🙏