Skip to content

Commit 5bc576f

Browse files
use checkout@v3, cache@v3 and run composer fix-style (#251)
* use checkout@v3, cache@v3 and run `composer fix-style` * fix cache.key missmatched
1 parent 5058451 commit 5bc576f

File tree

5 files changed

+40
-20
lines changed

5 files changed

+40
-20
lines changed

.github/workflows/lint.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,29 @@ jobs:
66
name: PHPStan
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@master
10-
- name: Install Dependencies
11-
run: composer install --no-progress
12-
- name: Run PHPStan
13-
run: ./vendor/bin/phpstan analyse --no-progress
9+
- uses: actions/checkout@v3
10+
- run: composer validate --strict
11+
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
12+
id: composer-cache
13+
- uses: actions/cache@v3
14+
with:
15+
path: ${{ steps.composer-cache.outputs.dir }}
16+
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
17+
restore-keys: dependencies-caches-php-
18+
- run: composer install --no-progress
19+
- run: composer phpstan
1420

1521
php_cs_fixer:
1622
name: PHP-CS-Fxier
1723
runs-on: ubuntu-latest
1824
steps:
19-
- uses: actions/checkout@master
20-
- name: Install Dependencies
21-
run: composer install --no-progress
22-
- name: Run PHP-CS-Fxier
23-
run: composer check-style
25+
- uses: actions/checkout@v3
26+
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
27+
id: composer-cache
28+
- uses: actions/cache@v3
29+
with:
30+
path: ${{ steps.composer-cache.outputs.dir }}
31+
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
32+
restore-keys: dependencies-caches-php-
33+
- run: composer install --no-progress
34+
- run: composer check-style

.github/workflows/test.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ jobs:
1515
- stable
1616
- lowest
1717
steps:
18-
- uses: actions/checkout@master
19-
- name: Install Dependencies
20-
run: composer update --prefer-dist --no-interaction --no-suggest --prefer-${{ matrix.perfer }}
21-
- name: Run PHPUnit
22-
run: ./vendor/bin/phpunit
18+
- uses: actions/checkout@v3
19+
- run: composer validate --strict
20+
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
21+
id: composer-cache
22+
- uses: actions/cache@v3
23+
with:
24+
path: ${{ steps.composer-cache.outputs.dir }}
25+
key: dependencies-caches-php-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: dependencies-caches-php-
27+
- run: composer update --prefer-dist --no-interaction --no-suggest --prefer-${{ matrix.perfer }}
28+
- run: ./vendor/bin/phpunit

src/Providers/Alipay.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function getUserByToken(string $token): array
7676
throw new Exceptions\BadRequestException((string) $responseInstance->getBody());
7777
}
7878

79-
return $response['alipay_user_info_share_response'] ?? [];
79+
return $response['alipay_user_info_share_response'];
8080
}
8181

8282
#[Pure]

src/Providers/Coding.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use JetBrains\PhpStorm\ArrayShape;
66
use JetBrains\PhpStorm\Pure;
77
use Overtrue\Socialite\Contracts;
8+
use Overtrue\Socialite\Exceptions;
89
use Overtrue\Socialite\Exceptions\InvalidArgumentException;
910
use Overtrue\Socialite\User;
10-
use Overtrue\Socialite\Exceptions;
1111

1212
class Coding extends Base
1313
{

src/Providers/OpenWeWork.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ class OpenWeWork extends Base
1717
public const NAME = 'open-wework';
1818

1919
protected bool $detailed = false;
20+
2021
protected bool $asQrcode = false;
22+
2123
protected string $userType = 'member';
24+
2225
protected string $lang = 'zh';
26+
2327
protected ?string $suiteTicket = null;
2428

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

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

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

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

0 commit comments

Comments
 (0)