From 4e8bbb417a05f48e01939465c519199777c6f8b5 Mon Sep 17 00:00:00 2001 From: Thomas Su Date: Tue, 2 May 2023 16:56:24 +0800 Subject: [PATCH] fix type hint errors --- src/QiniuAdapter.php | 4 ++-- tests/QiniuAdapterTest.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/QiniuAdapter.php b/src/QiniuAdapter.php index e1bc289..755ca53 100644 --- a/src/QiniuAdapter.php +++ b/src/QiniuAdapter.php @@ -88,7 +88,7 @@ public function read(string $path): string return $result; } - public function readStream(string $path): string + public function readStream(string $path) { if (ini_get('allow_url_fopen')) { if ($result = fopen($this->privateDownloadUrl($path), 'r')) { @@ -296,7 +296,7 @@ public function getUploadToken(string $key = null, int $expires = 3600, array $p { return $this->getAuthManager()->uploadToken($this->bucket, $key, $expires, $policy, $strictPolice); } - + public function verifyCallback(string $contentType = null, string $originAuthorization = null, string $url = null, string $body = null) { return $this->getAuthManager()->verifyCallback($contentType, $originAuthorization, $url, $body); diff --git a/tests/QiniuAdapterTest.php b/tests/QiniuAdapterTest.php index 5a3d037..9a6ea87 100644 --- a/tests/QiniuAdapterTest.php +++ b/tests/QiniuAdapterTest.php @@ -308,11 +308,11 @@ public function testGetUploadToken($adapter, $managers) $managers['authManager']->expects()->uploadToken('bucket', 'key', 7200, null, null)->andReturn('token'); $this->assertSame('token', $adapter->getUploadToken('key', 7200)); - $managers['authManager']->expects()->uploadToken('bucket', 'key', 7200, 'foo', null)->andReturn('token'); - $this->assertSame('token', $adapter->getUploadToken('key', 7200, 'foo')); + $managers['authManager']->expects()->uploadToken('bucket', 'key', 7200, ['foo'], null)->andReturn('token'); + $this->assertSame('token', $adapter->getUploadToken('key', 7200, ['foo'])); - $managers['authManager']->expects()->uploadToken('bucket', 'key', 7200, 'foo', 'bar')->andReturn('token'); - $this->assertSame('token', $adapter->getUploadToken('key', 7200, 'foo', 'bar')); + $managers['authManager']->expects()->uploadToken('bucket', 'key', 7200, ['foo'], 'bar')->andReturn('token'); + $this->assertSame('token', $adapter->getUploadToken('key', 7200, ['foo'], 'bar')); } /**