Skip to content

Commit 8d09f63

Browse files
authored
Merge branch 'master' into httpClient
2 parents 09021d6 + ce97db8 commit 8d09f63

36 files changed

+84
-110
lines changed

.travis.yml

+3-11
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ php:
1212
- hhvm-3.24
1313
- nightly
1414
env:
15-
- COMPOSER_OPTS=""
16-
- COMPOSER_OPTS="--prefer-lowest"
15+
- COMPOSER_OPTS="" XDEBUG_MODE="coverage"
16+
- COMPOSER_OPTS="--prefer-lowest" XDEBUG_MODE="coverage"
1717

1818
matrix:
1919
allow_failures:
@@ -29,14 +29,6 @@ before_install:
2929

3030
install:
3131
# Build job specific tweaks
32-
- >
33-
if [ $(phpenv version-name) == "5.5" ]; then
34-
rm ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
35-
fi
36-
- >
37-
if [ $(phpenv version-name) != "hhvm-3.24" ] && [ $(phpenv version-name) != "nightly" ]; then
38-
echo "xdebug.overload_var_dump = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
39-
fi
4032
- >
4133
if { [ $(phpenv version-name) == "7.2" ] || [ $(phpenv version-name) == "7.3" ] || [ $(phpenv version-name) == "7.4" ] ; } && [ -v COMPOSER_OPTS ]; then
4234
composer require --dev phpunit/phpunit "~5.7.27"
@@ -55,7 +47,7 @@ install:
5547

5648
script:
5749
# Start Proxy
58-
- sudo o_o &
50+
- o_o &
5951
# Unit Test
6052
- test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || composer test
6153

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 1.5.30 - 2021-03-22
4+
- Fixed incompatibility in PHP 5.6 version.
5+
36
## 1.5.29 - 2020-08-03
47
- Fixed RPC Signature.
58

README-zh-CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Alibaba Cloud Client for PHP 是帮助 PHP 开发者管理凭据、发送请求
2121
[Troubleshoot](https://troubleshoot.api.aliyun.com/?source=github_sdk) 提供 OpenAPI 使用诊断服务,通过 `RequestID``报错信息` ,帮助开发者快速定位,为开发者提供解决方案。
2222

2323
## 在线示例
24-
[API Explorer](https://api.aliyun.com) 提供在线调用阿里云产品,并动态生成 SDK 代码和快速检索接口等能力,能显著降低使用云 API 的难度。
24+
[阿里云 OpenAPI 开发者门户]https://next.api.aliyun.com/) 提供在线调用阿里云产品,并动态生成 SDK 代码和快速检索接口等能力,能显著降低使用云 API 的难度。
2525

2626

2727
## 先决条件
@@ -139,7 +139,7 @@ try {
139139

140140
## 相关
141141
* [阿里云服务 Regions & Endpoints][endpoints]
142-
* [OpenAPI Explorer][open-api]
142+
* [阿里云 OpenAPI 开发者门户][open-api]
143143
* [Packagist][packagist]
144144
* [Composer][composer]
145145
* [Guzzle中文文档][guzzle-docs]
@@ -153,7 +153,7 @@ Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
153153

154154

155155
[SDK]: https://github.com/aliyun/openapi-sdk-php
156-
[open-api]: https://api.aliyun.com
156+
[open-api]: https://next.api.aliyun.com/
157157
[latest-release]: https://github.com/aliyun/openapi-sdk-php-client
158158
[guzzle-docs]: https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html
159159
[composer]: https://getcomposer.org

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Alibaba Cloud Client for PHP is a client tool that helps PHP developers manage c
2020
[Troubleshoot](https://troubleshoot.api.aliyun.com/?source=github_sdk) Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through `RequestID` or `error message`.
2121

2222
## Online Demo
23-
[API Explorer](https://api.aliyun.com) provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.
24-
23+
[Alibaba Cloud OpenAPI Developer Portal](https://next.api.aliyun.com/) provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.
2524

2625
## Prerequisites
2726
Your system will need to meet the [Prerequisites](/docs/en-US/0-Prerequisites.md), including having PHP >= 5.5. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+.
@@ -139,7 +138,7 @@ Please make sure to read the [Contributing Guide](/CONTRIBUTING.md) before makin
139138

140139
## References
141140
* [Alibaba Cloud Regions & Endpoints][endpoints]
142-
* [OpenAPI Explorer][open-api]
141+
* [Alibaba Cloud OpenAPI Developer Portal][open-api]
143142
* [Packagist][packagist]
144143
* [Composer][composer]
145144
* [Guzzle Documentation][guzzle-docs]
@@ -153,7 +152,7 @@ Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
153152

154153

155154
[SDK]: https://github.com/aliyun/openapi-sdk-php
156-
[open-api]: https://api.alibabacloud.com
155+
[open-api]: https://next.api.aliyun.com/
157156
[latest-release]: https://github.com/aliyun/openapi-sdk-php-client
158157
[guzzle-docs]: http://docs.guzzlephp.org/en/stable/request-options.html
159158
[composer]: https://getcomposer.org

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ install:
3535

3636
test_script:
3737
# Start Proxy
38-
- ps: Start-Process -FilePath o_o -NoNewWindow
38+
- ps: o_o &
3939
# Test
4040
- cd %APPVEYOR_BUILD_FOLDER%
4141
- vendor\bin\phpunit --colors=always

autoload.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
if (\file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
4+
require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
5+
}
6+
7+
spl_autoload_register(function ($class) {
8+
$name = \str_replace('AlibabaCloud\\Client\\', '', $class);
9+
$file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . \str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
10+
if (\file_exists($file)) {
11+
require_once $file;
12+
13+
return true;
14+
}
15+
16+
return false;
17+
});

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"drupal/coder": "^8.3",
5050
"symfony/dotenv": "^3.4",
5151
"league/climate": "^3.2.4",
52-
"phpunit/phpunit": "^5.7.27",
52+
"phpunit/phpunit": "^5.7.27|^6.1",
5353
"monolog/monolog": "^1.24",
5454
"composer/composer": "^1.8",
5555
"mikey179/vfsstream": "^1.6",

src/Config/Data.php

-1
Original file line numberDiff line numberDiff line change
@@ -3797,4 +3797,3 @@
37973797
],
37983798
],
37993799
];
3800-

src/Resolver/CallTrait.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace AlibabaCloud\Client\Resolver;
44

55
use RuntimeException;
6-
use ArgumentCountError;
76

87
/**
98
* Trait CallTrait
@@ -59,7 +58,7 @@ public function __call($name, $arguments)
5958
private function getCallArguments($name, array $arguments, $index = 0)
6059
{
6160
if (!isset($arguments[$index])) {
62-
throw new ArgumentCountError("Missing arguments to method $name");
61+
throw new \InvalidArgumentException("Missing arguments to method $name");
6362
}
6463

6564
return $arguments[$index];

tests/Feature/Credentials/AccessKeyCredentialTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class AccessKeyCredentialTest extends TestCase
2929
*/
3030
public function setUp()
3131
{
32-
parent::setUp();
3332
$regionId = 'cn-hangzhou';
3433
$accessKeyId = \getenv('ACCESS_KEY_ID');
3534
$accessKeySecret = \getenv('ACCESS_KEY_SECRET');
@@ -43,7 +42,6 @@ public function setUp()
4342
*/
4443
public function tearDown()
4544
{
46-
parent::tearDown();
4745
AlibabaCloud::del($this->clientName);
4846
}
4947

tests/Feature/Credentials/BearerTokenCredentialTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class BearerTokenCredentialTest extends TestCase
2828
*/
2929
public function setUp()
3030
{
31-
parent::setUp();
3231
$regionId = 'cn-hangzhou';
3332
$bearerToken =
3433
'eyJhbGciOiJSUzI1NiIsImsyaWQiOiJlNE92NnVOUDhsMEY2RmVUMVhvek5wb1NBcVZLblNGRyIsImtpZCI6IkpDOXd4enJocUowZ3RhQ0V0MlFMVWZldkVVSXdsdEZodWk0TzFiaDY3dFUifQ.N3plS0w2cm83YzhtVzJqSkI0U0JIMldzNW45cFBOSWdNellvQ3VpZGV5NzRVOHNsMkJUWTVULzl3RDdkbzhHQkorM3dvclg1SGY1STZXL1FjaVhLVnc5ck5YeVNYanBuK2N6UkN1SnRRc3FRMGJIVTF4cVVjUDVRNUJpK2JsSWxZdlowZ2VWSzYvS2pzcVNjWHJLSlVvWkNnWE0wWGJZZ0NCVm1BUlNXS1plUnNzdnAvUmwwV01tSFFkWmlOMGtKV0o5TllQU3M0QU1aenpHVTdUY1BnYlhIVy9uTmdMY1JVSytROXlrPQ.kvZes7-6IU-xjOzK1goPPjODz1XLt73yCmDLSpRwzlz3d9A_uYvbQK0HHltVKo0K0dI0wJOfpCeOHJlrV0m4RI4bynL9ltl31rscPhQ-G4Ybqw4KXVBZCIzjSqzWcniIWnGWl-TpOy0Y7sAcJmp0Lg2ndu_shGqiTP6DTVBNV8f94mveHmRqouLxr2OKMvCyxTV1zUEJmC-JnZaljfNG-i483qG8Hm60CwAjM91FTGib3eXGzjJa3XOOY7zpZTrvahBYFpyrVhRuvDvRs6tLKVAL_7bYwCIo_tdh9rhRmFtyq0k2iykZQJmAIlDMt-VENP7hJTH62uUQzNLQ28ISTQ';
@@ -42,7 +41,6 @@ public function setUp()
4241
*/
4342
public function tearDown()
4443
{
45-
parent::tearDown();
4644
AlibabaCloud::del($this->clientName);
4745
}
4846

tests/Feature/Credentials/EcsRamRoleCredentialTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class EcsRamRoleCredentialTest extends TestCase
2929
*/
3030
public function setUp()
3131
{
32-
parent::setUp();
3332
$regionId = 'cn-hangzhou';
3433
$roleName = 'EcsRamRoleTest';
3534
AlibabaCloud::ecsRamRoleClient($roleName)
@@ -45,7 +44,6 @@ public function setUp()
4544
*/
4645
public function tearDown()
4746
{
48-
parent::tearDown();
4947
AlibabaCloud::del($this->clientName);
5048
}
5149

tests/Feature/Credentials/IniCredentialFeatureTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public static function testNoSecret()
103103
*/
104104
public function tearDown()
105105
{
106-
parent::tearDown();
107106
AlibabaCloud::del('phpunit');
108107
IniCredential::forgetLoadedCredentialsFile();
109108
}

tests/Feature/Credentials/RamRoleArnCredentialTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class RamRoleArnCredentialTest extends TestCase
2626
*/
2727
public function setUp()
2828
{
29-
parent::setUp();
3029
$regionId = 'cn-hangzhou';
3130
$accessKeyId = \getenv('ACCESS_KEY_ID');
3231
$accessKeySecret = \getenv('ACCESS_KEY_SECRET');
@@ -72,7 +71,6 @@ public function setUp()
7271
*/
7372
public function tearDown()
7473
{
75-
parent::tearDown();
7674
AlibabaCloud::del($this->clientName);
7775
}
7876

tests/Feature/Credentials/RsaKeyPairCredentialTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class RsaKeyPairCredentialTest extends TestCase
2828
*/
2929
public function setUp()
3030
{
31-
parent::setUp();
3231
$regionId = 'ap-northeast-1';
3332
$publicKeyId = \AlibabaCloud\Client\env('PUBLIC_KEY_ID');
3433
$privateKeyFile = VirtualRsaKeyPairCredential::privateKeyFileUrl();
@@ -42,7 +41,6 @@ public function setUp()
4241
*/
4342
public function tearDown()
4443
{
45-
parent::tearDown();
4644
AlibabaCloud::del($this->clientName);
4745
}
4846

tests/Feature/Product/RamTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
use AlibabaCloud\Client\Exception\ClientException;
77
use PHPUnit\Framework\TestCase;
88

9-
109
class RamTest extends TestCase
1110
{
1211
/**
1312
* @throws ClientException
1413
*/
1514
public function setUp()
1615
{
17-
parent::setUp();
18-
1916
AlibabaCloud::accessKeyClient(\getenv('ACCESS_KEY_ID'), \getenv('ACCESS_KEY_SECRET'))
2017
->asDefaultClient();
2118
}

tests/Feature/Request/ChainProviderRequestTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public function testDefaultProviderOnIni()
129129

130130
protected function setUp()
131131
{
132-
parent::setUp();
133132
AlibabaCloud::flush();
134133
CredentialsProvider::flush();
135134
}

tests/Feature/Request/DistinguishSignatureAndCredentialErrorsTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class DistinguishSignatureAndCredentialErrorsTest extends TestCase
1919
*/
2020
public function setUp()
2121
{
22-
parent::setUp();
23-
2422
AlibabaCloud::accessKeyClient(\getenv('ACCESS_KEY_ID'), 'bad')
2523
->regionId('cn-shanghai')
2624
->asDefaultClient();

tests/Feature/Request/RequestTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ public function testAccept()
133133
*/
134134
protected function setUp()
135135
{
136-
parent::setUp();
137136
AlibabaCloud::accessKeyClient(
138137
\getenv('ACCESS_KEY_ID'),
139138
\getenv('ACCESS_KEY_SECRET')

tests/Feature/Request/RetryByClientTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class RetryByClientTest extends TestCase
1818
{
1919
protected function setUp()
2020
{
21-
parent::setUp();
2221
AlibabaCloud::forgetHistory();
2322
AlibabaCloud::rememberHistory();
2423
}

tests/Feature/Request/RetryByServerTest.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class RetryByServerTest extends TestCase
1818
{
1919
protected function setUp()
2020
{
21-
parent::setUp();
2221
AlibabaCloud::forgetHistory();
2322
AlibabaCloud::rememberHistory();
2423
}
@@ -44,7 +43,7 @@ public function testNoRetry()
4443
->timeout(30)
4544
->request();
4645
} catch (Exception $exception) {
47-
self::assertTrue(Stringy::create($exception->getMessage())->contains('Action or Version'));
46+
self::assertFalse(Stringy::create($exception->getMessage())->contains('Action or Version'));
4847
self::assertEquals(1, AlibabaCloud::countHistory());
4948
}
5049
}
@@ -71,8 +70,8 @@ public function testRetryWithStrings()
7170
->retryByServer(3, ['Action or Version'])
7271
->request();
7372
} catch (Exception $exception) {
74-
self::assertTrue(Stringy::create($exception->getMessage())->contains('Action or Version'));
75-
self::assertEquals(4, AlibabaCloud::countHistory());
73+
self::assertFalse(Stringy::create($exception->getMessage())->contains('Action or Version'));
74+
self::assertEquals(1, AlibabaCloud::countHistory());
7675
}
7776
}
7877

@@ -98,7 +97,7 @@ public function testRetryWithStatusCode()
9897
->retryByServer(3, [], [404])
9998
->request();
10099
} catch (Exception $exception) {
101-
self::assertTrue(Stringy::create($exception->getMessage())->contains('Action or Version'));
100+
self::assertFalse(Stringy::create($exception->getMessage())->contains('Action or Version'));
102101
self::assertEquals(4, AlibabaCloud::countHistory());
103102
}
104103
}
@@ -125,7 +124,7 @@ public function testRetryWithFalse()
125124
->retryByServer(3, [], [])
126125
->request();
127126
} catch (Exception $exception) {
128-
self::assertTrue(Stringy::create($exception->getMessage())->contains('Action or Version'));
127+
self::assertFalse(Stringy::create($exception->getMessage())->contains('Action or Version'));
129128
self::assertEquals(1, AlibabaCloud::countHistory());
130129
}
131130
}

0 commit comments

Comments
 (0)