From d0b43f1eb86cba8fb082dfece1cb74cd2540a5b8 Mon Sep 17 00:00:00 2001 From: justmd5 Date: Fri, 17 Apr 2020 12:07:47 +0800 Subject: [PATCH 1/6] request params default set empty array --- src/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api.php b/src/Api.php index 6a522ad..e6b3b0f 100644 --- a/src/Api.php +++ b/src/Api.php @@ -51,7 +51,7 @@ private function signature($params) * * @return mixed */ - public function request($method, $params, $data_type = 'JSON') + public function request($method, $params=[], $data_type = 'JSON') { $http = $this->getHttp(); $params = $this->paramsHandle($params); From 921036fe85b3c5fcdbb8ffb649753b064b3bd935 Mon Sep 17 00:00:00 2001 From: justmd5 Date: Fri, 17 Apr 2020 04:08:05 +0000 Subject: [PATCH 2/6] Apply fixes from StyleCI [ci skip] [skip ci] --- src/Api.php | 2 +- src/Oauth/PreAuth.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Api.php b/src/Api.php index e6b3b0f..ebcd736 100644 --- a/src/Api.php +++ b/src/Api.php @@ -51,7 +51,7 @@ private function signature($params) * * @return mixed */ - public function request($method, $params=[], $data_type = 'JSON') + public function request($method, $params = [], $data_type = 'JSON') { $http = $this->getHttp(); $params = $this->paramsHandle($params); diff --git a/src/Oauth/PreAuth.php b/src/Oauth/PreAuth.php index 6ff0052..9164525 100755 --- a/src/Oauth/PreAuth.php +++ b/src/Oauth/PreAuth.php @@ -56,12 +56,12 @@ private function accessToken() public function authorizationUrl($state = null, $view = null) { return self::AUTHORIZE_API_ARR[strtoupper($this->app->getConfig('member_type'))].http_build_query([ - 'client_id' => $this->accessToken()->getClientId(), - 'response_type' => 'code', - 'state' => $state, - 'redirect_uri' => $this->accessToken()->getRedirectUri(), - 'view' => $view, - ]); + 'client_id' => $this->accessToken()->getClientId(), + 'response_type' => 'code', + 'state' => $state, + 'redirect_uri' => $this->accessToken()->getRedirectUri(), + 'view' => $view, + ]); } /** From 0c9aa6b6cdfff1778c30d9f63e2f435c7444ea1c Mon Sep 17 00:00:00 2001 From: justmd5 Date: Fri, 17 Apr 2020 04:11:12 +0000 Subject: [PATCH 3/6] Apply fixes from StyleCI [ci skip] [skip ci] --- src/Api.php | 2 +- src/Oauth/PreAuth.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Api.php b/src/Api.php index e6b3b0f..ebcd736 100644 --- a/src/Api.php +++ b/src/Api.php @@ -51,7 +51,7 @@ private function signature($params) * * @return mixed */ - public function request($method, $params=[], $data_type = 'JSON') + public function request($method, $params = [], $data_type = 'JSON') { $http = $this->getHttp(); $params = $this->paramsHandle($params); diff --git a/src/Oauth/PreAuth.php b/src/Oauth/PreAuth.php index 6ff0052..9164525 100755 --- a/src/Oauth/PreAuth.php +++ b/src/Oauth/PreAuth.php @@ -56,12 +56,12 @@ private function accessToken() public function authorizationUrl($state = null, $view = null) { return self::AUTHORIZE_API_ARR[strtoupper($this->app->getConfig('member_type'))].http_build_query([ - 'client_id' => $this->accessToken()->getClientId(), - 'response_type' => 'code', - 'state' => $state, - 'redirect_uri' => $this->accessToken()->getRedirectUri(), - 'view' => $view, - ]); + 'client_id' => $this->accessToken()->getClientId(), + 'response_type' => 'code', + 'state' => $state, + 'redirect_uri' => $this->accessToken()->getRedirectUri(), + 'view' => $view, + ]); } /** From dc02b55b027784cb35edabf75e3f5110b0c8134e Mon Sep 17 00:00:00 2001 From: justmd5 Date: Fri, 8 May 2020 17:40:43 +0800 Subject: [PATCH 4/6] Create php.yml --- .github/workflows/php.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..9d1b435 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,27 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test From f92681f02832a91b88d3cd1b7d77c963d2a3aa66 Mon Sep 17 00:00:00 2001 From: justmd5 Date: Thu, 11 Jun 2020 21:11:45 +0000 Subject: [PATCH 5/6] Update hanson/foundation-sdk requirement from ^3.0 to ^3.0 || ^4.0 Updates the requirements on [hanson/foundation-sdk](https://github.com/Hanson/foundation-sdk) to permit the latest version. - [Release notes](https://github.com/Hanson/foundation-sdk/releases) - [Commits](https://github.com/Hanson/foundation-sdk/compare/3.0.0...4.0.1) Signed-off-by: dependabot-preview[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 36e6a9d..b5d4270 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": ">=7.0", - "hanson/foundation-sdk": "^3.0", + "hanson/foundation-sdk": "^3.0 || ^4.0", "ext-json": "*" } } From 374d82e1d19c7637d808680dff44e529dbd2aa1b Mon Sep 17 00:00:00 2001 From: justmd5 Date: Mon, 15 Jun 2020 15:58:10 +0800 Subject: [PATCH 6/6] fix #12 Argument 1 passed to Hanson\\Foundation\\Http::__construct() must be an instance of Hanson\\Foundation\\Foundation, null given, called --- src/Api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Api.php b/src/Api.php index ebcd736..b248a37 100644 --- a/src/Api.php +++ b/src/Api.php @@ -22,6 +22,7 @@ class Api extends AbstractAPI public function __construct(PinDuoDuo $pinduoduo, $needToken = false) { + parent::__construct($pinduoduo); $this->pinduoduo = $pinduoduo; $this->needToken = $needToken; }