Skip to content

Develop #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Qiniu/Rtc/AppClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
}
if (!empty($noAutoKickUser)) {
if ($noAutoKickUser !== null) {
$params['noAutoKickUser'] = $noAutoKickUser;
}
$body = json_encode($params);
Expand Down Expand Up @@ -65,7 +65,7 @@ public function updateApp($appId, $hub, $title, $maxUsers = null, $mergePublishR
if (!empty($maxUsers)) {
$params['maxUsers'] = $maxUsers;
}
if (!empty($noAutoKickUser)) {
if ($noAutoKickUser !== null) {
$params['noAutoKickUser'] = $noAutoKickUser;
}
if (!empty($mergePublishRtmp)) {
Expand Down
36 changes: 18 additions & 18 deletions src/Qiniu/Sms/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(Auth $auth)
"signature_id": <signature_id>
}
*/
public function createSignature(string $signature, string $source, string $pics = null)
public function createSignature($signature, $source, $pics = null)
{
$params['signature'] = $signature;
$params['source'] = $source;
Expand Down Expand Up @@ -62,7 +62,7 @@ public function createSignature(string $signature, string $source, string $pics
"signature": string
}
*/
public function updateSignature(string $id, string $signature, string $source, string $pics = null)
public function updateSignature($id, $signature, $source, $pics = null)
{
$params['signature'] = $signature;
$params['source'] = $source;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function updateSignature(string $id, string $signature, string $source, s
"page_size": int,
}
*/
public function checkSignature(string $audit_status = null, int $page = 1, int $page_size = 20)
public function checkSignature($audit_status = null, $page = 1, $page_size = 20)
{

$url = sprintf(
Expand All @@ -116,7 +116,7 @@ public function checkSignature(string $audit_status = null, int $page = 1, int $
* id 签名id string 类型,必填,
* @retrun : 请求成功 HTTP 状态码为 200
*/
public function deleteSignature(string $id)
public function deleteSignature($id)
{
$url = $this->baseURL . 'signature/' . $id;
list(, $err) = $this->delete($url);
Expand All @@ -139,11 +139,11 @@ public function deleteSignature(string $id)
}
*/
public function createTemplate(
string $name,
string $template,
string $type,
string $description,
string $signture_id
$name,
$template,
$type,
$description,
$signture_id
) {
$params['name'] = $name;
$params['template'] = $template;
Expand Down Expand Up @@ -181,7 +181,7 @@ public function createTemplate(
"page_size": int
}
*/
public function queryTemplate(string $audit_status = null, int $page = 1, int $page_size = 20)
public function queryTemplate($audit_status = null, $page = 1, $page_size = 20)
{

$url = sprintf(
Expand All @@ -205,11 +205,11 @@ public function queryTemplate(string $audit_status = null, int $page = 1, int $p
* @retrun : 请求成功 HTTP 状态码为 200
*/
public function updateTemplate(
string $id,
string $name,
string $template,
string $description,
string $signature_id
$id,
$name,
$template,
$description,
$signature_id
) {
$params['name'] = $name;
$params['template'] = $template;
Expand All @@ -226,7 +226,7 @@ public function updateTemplate(
* id :模板id string 类型,必填,
* @retrun : 请求成功 HTTP 状态码为 200
*/
public function deleteTemplate(string $id)
public function deleteTemplate($id)
{
$url = $this->baseURL . 'template/' . $id;
list(, $err) = $this->delete($url);
Expand All @@ -243,7 +243,7 @@ public function deleteTemplate(string $id)
"job_id": string
}
*/
public function sendMessage(string $template_id, array $mobiles, array $parameters = null)
public function sendMessage($template_id, $mobiles, $parameters = null)
{
$params['template_id'] = $template_id;
$params['mobiles'] = $mobiles;
Expand All @@ -256,7 +256,7 @@ public function sendMessage(string $template_id, array $mobiles, array $paramete
return $ret;
}

public function imgToBase64(string $img_file)
public function imgToBase64($img_file)
{
$img_base64 = '';
if (file_exists($img_file)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/Storage/BucketManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function listbuckets(
$line = 'false',
$shared = 'false'
) {
$path = '/v3/buckets?region=' . $region . '&line=' . $line . '&shared=' . $share;
$path = '/v3/buckets?region=' . $region . '&line=' . $line . '&shared=' . $shared;
$info = $this->ucPost($path);
return $info;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/Storage/UploadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function put(
$data,
$params = null,
$mime = 'application/octet-stream',
$fname = null
$fname = "default_filename"
) {

$params = self::trimParams($params);
Expand Down
2 changes: 1 addition & 1 deletion tests/Qiniu/Tests/CdnManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp()

$this->cdnManager = new CdnManager($testAuth);
$this->encryptKey = $timestampAntiLeechEncryptKey;
$this->imgUrl = $customDomain . '/24.jpg';
$this->imgUrl = $customDomain . '/sdktest.png';
}

public function testCreateTimestampAntiLeechUrl()
Expand Down
4 changes: 2 additions & 2 deletions tests/Qiniu/Tests/DownloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DownloadTest extends \PHPUnit_Framework_TestCase
public function test()
{
global $testAuth;
$base_url = 'http://private-res.qiniudn.com/gogopher.jpg';
$base_url = 'http://sdk.peterpy.cn/gogopher.jpg';
$private_url = $testAuth->privateDownloadUrl($base_url);
$response = Client::get($private_url);
$this->assertEquals(200, $response->statusCode);
Expand All @@ -17,7 +17,7 @@ public function test()
public function testFop()
{
global $testAuth;
$base_url = 'http://private-res.qiniudn.com/gogopher.jpg?exif';
$base_url = 'http://sdk.peterpy.cn/gogopher.jpg?exif';
$private_url = $testAuth->privateDownloadUrl($base_url);
$response = Client::get($private_url);
$this->assertEquals(200, $response->statusCode);
Expand Down
2 changes: 1 addition & 1 deletion tests/Qiniu/Tests/FopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FopTest extends \PHPUnit_Framework_TestCase
{
public function testExifPub()
{
$fop = new Operation('testres.qiniudn.com');
$fop = new Operation('sdk.peterpy.cn');
list($exif, $error) = $fop->execute('gogopher.jpg', 'exif');
$this->assertNull($error);
$this->assertNotNull($exif);
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

//cdn
$timestampAntiLeechEncryptKey = getenv('QINIU_TIMESTAMP_ENCRPTKEY');
$customDomain = "http://phpsdk.peterpy.cn";
$customDomain = "http://sdk.peterpy.cn";

$tid = getenv('TRAVIS_JOB_NUMBER');
if (!empty($tid)) {
Expand Down