Skip to content

Commit

Permalink
Merge pull request #59 from xinningsu/fix-type-hint
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored May 2, 2023
2 parents 974f570 + 4e8bbb4 commit cf87e0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/QiniuAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions tests/QiniuAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

/**
Expand Down

0 comments on commit cf87e0f

Please sign in to comment.