diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1f10680..0bb9f50 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -81,43 +81,6 @@ jobs: fail_ci_if_error: false verbose: true - runner-phpcs: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [ '7.4' ] - name: Coding style (${{ matrix.php }}) - steps: - - uses: actions/checkout@master - - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extension: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip - coverage: none - - - name: Install Reviewdog - run: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $PWD/ v0.9.14 - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ matrix.php }}-composer- - - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - - - name: PHPCS - run: composer actions/phpcs | ./reviewdog -f=checkstyle -name=PHPCS -reporter=github-pr-check - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - phpcsfixer: runs-on: ubuntu-latest strategy: diff --git a/.gitignore b/.gitignore index 10104c1..e427e73 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ coverage node_modules yarn.lock composer.lock +.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..d6a8fda --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,14 @@ +in(__DIR__) +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@Symfony' => true, + 'full_opening_tag' => false, + 'phpdoc_align' => false, +]) + ->setFinder($finder) + ; \ No newline at end of file diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 6692a08..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,16 +0,0 @@ -in(__DIR__.'/{src,tests}') -; - -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR2' => true, - '@Symfony' => true, - '@Symfony:risky' => false, - 'phpdoc_align' => false, - 'no_superfluous_phpdoc_tags' => false, - 'array_syntax' => ['syntax' => 'short'], - ]) - ->setFinder($finder); diff --git a/composer.json b/composer.json index 0466b7f..6714028 100644 --- a/composer.json +++ b/composer.json @@ -29,35 +29,20 @@ "symfony/http-client": "^4.4 | ^5.2", "symfony/http-foundation": "^4.4 | ^5.2", "symfony/http-kernel": "^4.4 | ^5.2", - "symfony/security": "^4.4 | ^5.2" + "symfony/security-guard": "^4.4 | <5.3" }, "require-dev": { "drenso/phan-extensions": "^3.1", - "escapestudios/symfony2-coding-standard": "^3.10", - "friendsofphp/php-cs-fixer": "^2.13", + "friendsofphp/php-cs-fixer": "^3.2", "symfony/phpunit-bridge": "^4.4 | ^5.2", "vimeo/psalm": "^4.8" }, "scripts": { - "apply-coding-standards": [ - "@apply-coding-standards/php-cs-fixer", - "@apply-coding-standards/phpcs" + "coding-standards-apply": [ + "php-cs-fixer fix" ], - "check-coding-standards": [ - "@check-coding-standards/php-cs-fixer", - "@check-coding-standards/phpcs" - ], - "check-coding-standards/php-cs-fixer": [ - "php-cs-fixer --config=.php_cs.dist fix --dry-run --format=checkstyle" - ], - "check-coding-standards/phpcs": [ - "phpcs --standard=phpcs.xml.dist" - ], - "apply-coding-standards/php-cs-fixer": [ - "php-cs-fixer --config=.php_cs.dist fix" - ], - "apply-coding-standards/phpcs": [ - "phpcbf --standard=phpcs.xml.dist" + "coding-standards-check": [ + "php-cs-fixer fix --dry-run --format=checkstyle" ], "phan": [ "./vendor/bin/phan --allow-polyfill-parser" @@ -68,11 +53,8 @@ "test-suite": [ "@phpunit" ], - "actions/phpcs": [ - "phpcs --standard=phpcs.xml.dist --report=checkstyle" - ], "actions/phpcsfixer": [ - "php-cs-fixer --config=.php_cs.dist fix --dry-run --diff --diff-format=udiff" + "php-cs-fixer fix --dry-run --format=checkstyle" ], "actions/phan": [ "./vendor/bin/phan --no-progress-bar --allow-polyfill-parser" diff --git a/src/Security/User.php b/src/Security/User.php index c5cfe41..6b0b439 100644 --- a/src/Security/User.php +++ b/src/Security/User.php @@ -21,8 +21,6 @@ class User implements UserInterface /** * Get this users "password" expire date. - * - * @return \DateTime|null */ public function getExpires(): ?\DateTime { @@ -31,8 +29,6 @@ public function getExpires(): ?\DateTime /** * Set this users "password" expire date. - * - * @param \DateTime $expires */ public function setExpires(\DateTime $expires): void { @@ -41,8 +37,6 @@ public function setExpires(\DateTime $expires): void /** * Get the users agency. - * - * @return string */ public function getAgency(): string { @@ -51,8 +45,6 @@ public function getAgency(): string /** * Set the users agency. - * - * @param string $agency */ public function setAgency(string $agency): void { @@ -61,8 +53,6 @@ public function setAgency(string $agency): void /** * Get users authentication type. - * - * @return string */ public function getAuthType(): string { @@ -71,8 +61,6 @@ public function getAuthType(): string /** * Set users authentication type. - * - * @param string $authType */ public function setAuthType(string $authType): void { @@ -81,8 +69,6 @@ public function setAuthType(string $authType): void /** * Get users client id. - * - * @return string */ public function getClientId(): string { @@ -91,8 +77,6 @@ public function getClientId(): string /** * Set users client id. - * - * @param string $clientId */ public function setClientId(string $clientId): void { @@ -109,8 +93,6 @@ public function getRoles(): array /** * {@inheritdoc} - * - * @return string|null */ public function getPassword(): ?string { @@ -135,14 +117,20 @@ public function getSalt(): ?string /** * {@inheritdoc} - * - * @return string */ public function getUsername(): string { return $this->agency; } + /** + * {@inheritdoc} + */ + public function getUserIdentifier(): string + { + return $this->agency; + } + /** * {@inheritdoc} */