Skip to content

Commit

Permalink
simpler, faster, code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yivi committed Aug 27, 2021
1 parent 348fdc5 commit 1754277
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/bundle_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:

jobs:

build:
test:
runs-on: ${{ matrix.operating-system }}
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php: [ '8.0' ]
symfony: ['~5.3.0']
symfony: [ '~5.3.0' ]

steps:
- uses: actions/checkout@master
Expand All @@ -38,40 +38,25 @@ jobs:

- uses: codecov/codecov-action@v2
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

- name: Run Psalm
run: ./vendor/bin/psalm

style_coverage_commit:
php-cs-fixer:
runs-on: ubuntu-latest
needs: build
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: install deps, to execute things
run: composer install --no-scripts --no-autoloader --no-progress --ignore-platform-reqs

- name: install php cs fixer
run: composer bin csfixer install --no-progress --ignore-platform-reqs

- name: fix style
run: ./vendor/bin/php-cs-fixer fix
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga

- name: Commit changes
uses: stefanzweifel/[email protected]
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Auto Code Style Fix
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commit_message: Apply Code Style Fixes
4 changes: 2 additions & 2 deletions src/Security/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public function __construct(
private AuthenticationSuccessHandler $successHandler,
private RefreshTokenProviderInterface $tokenProvider,
private string $parameterName
) {
}
) {}

public function authenticate(HttpFoundation\Request $request): PassportInterface
{
$credentials = (string) $request->request->get($this->parameterName);

if (!str_contains($credentials, ':')) {

throw new AuthenticationException('Invalid Token Format');
}

Expand Down
4 changes: 1 addition & 3 deletions src/YivoffJwtRefreshBundle.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php

declare(strict_types=1);
<?php declare(strict_types=1);

namespace Yivoff\JwtRefreshBundle;

Expand Down

0 comments on commit 1754277

Please sign in to comment.