Skip to content

Commit 17b808c

Browse files
authored
Run coding style checks on github action (#646)
* Run CS on github action * Remove CS from travis * Rename workflow * Disable CS cache * Fix failing cs checks
1 parent ad244c9 commit 17b808c

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Continuous integration'
2+
on: ['push', 'pull_request']
3+
jobs:
4+
php-cs:
5+
runs-on: 'ubuntu-latest'
6+
name: 'PHP coding style'
7+
steps:
8+
- name: 'Checkout'
9+
uses: 'actions/checkout@v2'
10+
11+
- name: 'Setup PHP'
12+
uses: 'shivammathur/setup-php@v2'
13+
with:
14+
php-version: '7.4'
15+
extensions: 'json, mbstring, tokenizer'
16+
tools: 'cs2pr, php-cs-fixer:2.16.4'
17+
env:
18+
update: true
19+
20+
- name: 'Check coding style'
21+
run: 'php-cs-fixer fix --diff --dry-run --using-cache=false --format=checkstyle | cs2pr'

.php_cs renamed to .php_cs.dist

File renamed without changes.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QA_DOCKER_IMAGE=jakzal/phpqa:alpine
22
QA_DOCKER_COMMAND=docker run -it --rm -v "$(shell pwd):/project" -w /project ${QA_DOCKER_IMAGE}
33

44
dist: cs-full phpstan phpunit
5-
ci: cs-full-check phpstan phpunit-coverage
5+
ci: phpstan phpunit-coverage
66
lint: cs-full-check phpstan
77

88
phpstan:

Security/Authentication/Provider/OAuthProvider.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,7 @@ public function authenticate(TokenInterface $token)
8585
try {
8686
$this->userChecker->checkPreAuth($user);
8787
} catch (AccountStatusException $e) {
88-
throw new OAuth2AuthenticateException(Response::HTTP_UNAUTHORIZED,
89-
OAuth2::TOKEN_TYPE_BEARER,
90-
$this->serverService->getVariable(OAuth2::CONFIG_WWW_REALM),
91-
'access_denied',
92-
$e->getMessage()
93-
);
88+
throw new OAuth2AuthenticateException(Response::HTTP_UNAUTHORIZED, OAuth2::TOKEN_TYPE_BEARER, $this->serverService->getVariable(OAuth2::CONFIG_WWW_REALM), 'access_denied', $e->getMessage());
9489
}
9590

9691
$token->setUser($user);
@@ -114,12 +109,7 @@ public function authenticate(TokenInterface $token)
114109
try {
115110
$this->userChecker->checkPostAuth($user);
116111
} catch (AccountStatusException $e) {
117-
throw new OAuth2AuthenticateException(Response::HTTP_UNAUTHORIZED,
118-
OAuth2::TOKEN_TYPE_BEARER,
119-
$this->serverService->getVariable(OAuth2::CONFIG_WWW_REALM),
120-
'access_denied',
121-
$e->getMessage()
122-
);
112+
throw new OAuth2AuthenticateException(Response::HTTP_UNAUTHORIZED, OAuth2::TOKEN_TYPE_BEARER, $this->serverService->getVariable(OAuth2::CONFIG_WWW_REALM), 'access_denied', $e->getMessage());
123113
}
124114

125115
$token->setUser($user);

0 commit comments

Comments
 (0)