Skip to content

Commit

Permalink
use checkout@v3, cache@v3 and run composer fix-style (#251)
Browse files Browse the repository at this point in the history
* use checkout@v3, cache@v3 and run `composer fix-style`

* fix cache.key missmatched
  • Loading branch information
TheNorthMemory authored Nov 1, 2022
1 parent 5058451 commit 5bc576f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@ jobs:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Dependencies
run: composer install --no-progress
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse --no-progress
- uses: actions/checkout@v3
- run: composer validate --strict
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
id: composer-cache
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-caches-php-
- run: composer install --no-progress
- run: composer phpstan

php_cs_fixer:
name: PHP-CS-Fxier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Dependencies
run: composer install --no-progress
- name: Run PHP-CS-Fxier
run: composer check-style
- uses: actions/checkout@v3
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
id: composer-cache
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-caches-php-
- run: composer install --no-progress
- run: composer check-style
16 changes: 11 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ jobs:
- stable
- lowest
steps:
- uses: actions/checkout@master
- name: Install Dependencies
run: composer update --prefer-dist --no-interaction --no-suggest --prefer-${{ matrix.perfer }}
- name: Run PHPUnit
run: ./vendor/bin/phpunit
- uses: actions/checkout@v3
- run: composer validate --strict
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
id: composer-cache
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-caches-php-
- run: composer update --prefer-dist --no-interaction --no-suggest --prefer-${{ matrix.perfer }}
- run: ./vendor/bin/phpunit
2 changes: 1 addition & 1 deletion src/Providers/Alipay.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function getUserByToken(string $token): array
throw new Exceptions\BadRequestException((string) $responseInstance->getBody());
}

return $response['alipay_user_info_share_response'] ?? [];
return $response['alipay_user_info_share_response'];
}

#[Pure]
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/Coding.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use JetBrains\PhpStorm\ArrayShape;
use JetBrains\PhpStorm\Pure;
use Overtrue\Socialite\Contracts;
use Overtrue\Socialite\Exceptions;
use Overtrue\Socialite\Exceptions\InvalidArgumentException;
use Overtrue\Socialite\User;
use Overtrue\Socialite\Exceptions;

class Coding extends Base
{
Expand Down
9 changes: 6 additions & 3 deletions src/Providers/OpenWeWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ class OpenWeWork extends Base
public const NAME = 'open-wework';

protected bool $detailed = false;

protected bool $asQrcode = false;

protected string $userType = 'member';

protected string $lang = 'zh';

protected ?string $suiteTicket = null;

protected ?int $agentId = null;
Expand Down Expand Up @@ -127,7 +131,6 @@ public function getAuthUrl(): string
return \sprintf('https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?%s', http_build_query($queries));
}


return \sprintf('https://open.weixin.qq.com/connect/oauth2/authorize?%s#wechat_redirect', \http_build_query($queries));
}

Expand Down Expand Up @@ -164,7 +167,7 @@ protected function getUser(string $token, string $code): array
$response = $this->fromJsonBody($responseInstance);

if (($response['errcode'] ?? 1) > 0 || (empty($response['UserId']) && empty($response['openid']))) {
throw new Exceptions\AuthorizeFailedException((string)$responseInstance->getBody(), $response);
throw new Exceptions\AuthorizeFailedException((string) $responseInstance->getBody(), $response);
} elseif (empty($response['user_ticket'])) {
$this->detailed = false;
}
Expand All @@ -179,7 +182,7 @@ protected function getUser(string $token, string $code): array
protected function getUserByTicket(string $userTicket): array
{
$responseInstance = $this->getHttpClient()->post(
$this->baseUrl . '/cgi-bin/service/auth/getuserdetail3rd',
$this->baseUrl.'/cgi-bin/service/auth/getuserdetail3rd',
[
'query' => [
'suite_access_token' => $this->getSuiteAccessToken(),
Expand Down

0 comments on commit 5bc576f

Please sign in to comment.