From 8a1d398b32bd8f7bdbf7a569834bd5b73a3cdc82 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 10:50:31 +0100 Subject: [PATCH 01/11] Fix phpstan errors Prior to this change, the pipeline was red because there were some phpstan errors. Also phpmd complained about unused private fields, but they were not unused... --- ci/qa/phpmd.xml | 1 + ci/qa/phpunit.xml | 1 + .../Exception/AccessDeniedToResourceException.php | 2 +- .../Exception/ResourceReadException.php | 2 +- .../Identity/Dto/RaCandidateSearchQuery.php | 2 +- src/Surfnet/StepupMiddlewareClient/Service/ApiService.php | 4 ++-- .../Configuration/Service/RaLocationService.php | 2 +- .../Identity/Service/ProfileService.php | 2 +- .../Identity/Service/RaListingService.php | 2 +- .../Identity/Service/RaService.php | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ci/qa/phpmd.xml b/ci/qa/phpmd.xml index d1d1d67..a554bfc 100644 --- a/ci/qa/phpmd.xml +++ b/ci/qa/phpmd.xml @@ -14,6 +14,7 @@ + diff --git a/ci/qa/phpunit.xml b/ci/qa/phpunit.xml index b3e10a1..5c04cf8 100644 --- a/ci/qa/phpunit.xml +++ b/ci/qa/phpunit.xml @@ -5,6 +5,7 @@ backupGlobals="false" colors="true" bootstrap="../../vendor/autoload.php" + cacheDirectory="../../var/qa/phpunit.cache" > diff --git a/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php b/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php index fc7b943..d81480c 100644 --- a/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php +++ b/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php @@ -30,7 +30,7 @@ class AccessDeniedToResourceException extends RuntimeException implements ApiErr * @param int $code * @param null|Exception $previous */ - public function __construct(string $resource, private readonly array $errors, $code = 0, Exception $previous = null) + public function __construct(string $resource, private readonly array $errors, $code = 0, ?Exception $previous = null) { $message = sprintf("Access denied to resource '%s': are you properly authorised?", $resource); diff --git a/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php b/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php index 891c039..a035d61 100644 --- a/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php +++ b/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php @@ -29,7 +29,7 @@ class ResourceReadException extends RuntimeException implements ApiErrorExceptio * @param int $code * @param null|Exception $previous */ - public function __construct(string $message, private readonly array $errors, $code = 0, Exception $previous = null) + public function __construct(string $message, private readonly array $errors, $code = 0, ?Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaCandidateSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaCandidateSearchQuery.php index 3e861bb..a817c13 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaCandidateSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaCandidateSearchQuery.php @@ -139,7 +139,7 @@ public function toHttpQuery(): string ); } - private function assertNonEmptyString(string $value, string $parameterName, string $message = null): void + private function assertNonEmptyString(string $value, string $parameterName, ?string $message = null): void { $message = sprintf( $message ?: '"%s" must be a non-empty string, "%s" given', diff --git a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php index 35c04fe..1dc651a 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php @@ -52,7 +52,7 @@ public function __construct(private readonly Client $guzzleClient) * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. * @throws GuzzleException */ - public function read(string $path, array $parameters = [], HttpQuery $httpQuery = null): ?array + public function read(string $path, array $parameters = [], ?HttpQuery $httpQuery = null): ?array { $resource = $this->buildResourcePath($path, $parameters, $httpQuery); @@ -92,7 +92,7 @@ public function read(string $path, array $parameters = [], HttpQuery $httpQuery * @param HttpQuery|null $httpQuery * @return string */ - private function buildResourcePath(string $path, array $parameters, HttpQuery $httpQuery = null): string + private function buildResourcePath(string $path, array $parameters, ?HttpQuery $httpQuery = null): string { $resource = $parameters !== [] ? vsprintf($path, array_map('urlencode', $parameters)) : $path; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php index 374c0b8..119b534 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php @@ -82,7 +82,7 @@ public function search(RaLocationSearchQuery $searchQuery): RaLocationCollection * @param object $value * @param string|null $message */ - private function assertIsValid(mixed $value, string $message = null): void + private function assertIsValid(mixed $value, ?string $message = null): void { $violations = $this->validator->validate($value); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php index 8d4cae9..5f1481e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php @@ -56,7 +56,7 @@ public function get(string $identityId): ?Profile * @param object $value * @param string|null $message */ - private function assertIsValid(mixed $value, string $message = null): void + private function assertIsValid(mixed $value, ?string $message = null): void { $violations = $this->validator->validate($value); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php index aedcf6a..5b075b2 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php @@ -78,7 +78,7 @@ public function search(RaListingSearchQuery $searchQuery): RaListingCollection * @param object $value * @param string|null $message */ - private function assertIsValid(mixed $value, string $message = null): void + private function assertIsValid(mixed $value, ?string $message = null): void { $violations = $this->validator->validate($value); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php index 0e6d027..a6e9804 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php @@ -57,7 +57,7 @@ public function listRas(string $institution): RegistrationAuthorityCredentialsCo * @param object $value * @param string|null $message */ - private function assertIsValid(mixed $value, string $message = null): void + private function assertIsValid(mixed $value, ?string $message = null): void { $violations = $this->validator->validate($value); From c2f0945bb414326d319509d86bbc22fa933bbdbb Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 11:01:18 +0100 Subject: [PATCH 02/11] Update packages `slevomat/coding-standard` `surfnet/stepup-bundle` `surfnet/stepup-saml-bundle` and requirements. Remove phpcpd as it is abandoned. --- ci/qa/phpcpd | 10 ---------- composer.json | 20 +++++++++----------- 2 files changed, 9 insertions(+), 21 deletions(-) delete mode 100755 ci/qa/phpcpd diff --git a/ci/qa/phpcpd b/ci/qa/phpcpd deleted file mode 100755 index b4bb0ca..0000000 --- a/ci/qa/phpcpd +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -cd $(dirname $0)/../../ - -# https://github.com/sebastianbergmann/phpcpd -./vendor/bin/phpcpd \ - --exclude src/Surfnet/StepupMiddlewareClient/Identity/Dto/ \ - --exclude src/Surfnet/StepupMiddlewareClient/Tests/ \ - --exclude src/Surfnet/StepupMiddlewareClientBundle/Tests/ \ - ./src $1 diff --git a/composer.json b/composer.json index 3c8637e..4661a40 100644 --- a/composer.json +++ b/composer.json @@ -11,17 +11,18 @@ }, "require": { "php": "^8.1", - "psr/log": "~2.0", - "surfnet/stepup-bundle": "^6.0", + "beberlei/assert": "~2.0", + "brick/math": "^0.11.0", + "guzzlehttp/guzzle": "^7.8", + "psr/log": "^3.0", + "ramsey/uuid": "^4.7", + "surfnet/stepup-bundle": "^7.0.1", + "surfnet/stepup-saml-bundle": "^7.0.1", "symfony/config": "^5.4|^6.3", "symfony/dependency-injection": "^5.4|^6.3", "symfony/framework-bundle": "^5.4|^6.3", "symfony/http-kernel": "^5.4|^6.3", - "symfony/validator": "^5.4|^6.3", - "guzzlehttp/guzzle": "^7.8", - "beberlei/assert": "~2.0", - "ramsey/uuid": "^4.7", - "brick/math": "^0.11.0" + "symfony/validator": "^5.4|^6.3" }, "require-dev": { "matthiasnoback/symfony-config-test": "^4.0|^v5.0.0", @@ -31,8 +32,7 @@ "phpstan/phpstan": "^1.10", "phpstan/phpstan-symfony": "^1.3", "phpunit/phpunit": "^9.6", - "sebastian/phpcpd": "^6.0", - "slevomat/coding-standard": "^8.13", + "slevomat/coding-standard": "^8.22", "squizlabs/php_codesniffer": "^3.7.1", "symfony/phpunit-bridge": "^5.4|^6.3" }, @@ -40,7 +40,6 @@ "check": [ "@composer-validate", "@phplint", - "@phpcpd", "@phpcs", "@phpmd", "@phpstan", @@ -49,7 +48,6 @@ "composer-validate": "./ci/qa/validate", "phplint": "./ci/qa/phplint", "phpcs": "./ci/qa/phpcs", - "phpcpd": "./ci/qa/phpcpd", "phpmd": "./ci/qa/phpmd", "phpstan": "./ci/qa/phpstan", "phpstan-baseline": "./ci/qa/phpstan-update-baseline", From fa7348885455854a09f42d280b977d87d8f2ff80 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 13:39:08 +0100 Subject: [PATCH 03/11] docheader, phpstan & rector - Add docheader check - Fix docheader - Upgrade phpstan & fix issues - Add rector --- .docheader | 15 +++++++++++ .github/workflows/test-integration.yml | 26 +++++++------------ ci/qa/docheader | 5 ++++ ci/qa/rector.php | 21 +++++++++++++++ ci/qa/rector.sh | 5 ++++ composer.json | 14 ++++++++-- .../Dto/RaLocationSearchQuery.php | 16 ++++++++++++ .../Identity/Dto/RecoveryTokenSearchQuery.php | 4 +-- .../Service/ApiService.php | 5 +++- .../Service/CommandService.php | 7 ----- .../Command/AbstractCommand.php | 2 +- ...egisterSelfAssertedSecondFactorCommand.php | 2 +- .../Command/SaveVettingTypeHintCommand.php | 2 +- .../Command/SelfVetSecondFactorCommand.php | 2 +- .../Service/RaSecondFactorService.php | 2 +- .../Identity/Service/SecondFactorService.php | 2 +- 16 files changed, 96 insertions(+), 34 deletions(-) create mode 100755 .docheader create mode 100755 ci/qa/docheader create mode 100644 ci/qa/rector.php create mode 100755 ci/qa/rector.sh diff --git a/.docheader b/.docheader new file mode 100755 index 0000000..a12ddf8 --- /dev/null +++ b/.docheader @@ -0,0 +1,15 @@ +/** + * Copyright %regexp:\d{4}% SURFnet %regexp:(B.V.|bv)% + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 54e2585..02aaf21 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -1,35 +1,29 @@ name: test-integration -on: [ push ] +on: + pull_request: + push: + branches: + - main + workflow_dispatch: jobs: build: runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} strategy: matrix: - php-versions: [ '8.2'] - experimental: [false] - include: - - php-versions: '8.1' - experimental: true - - php-versions: '8.3' - experimental: true - - php-versions: '8.4' - experimental: true + php-versions: ['8.2', '8.3', '8.4', '8.5'] timeout-minutes: 30 - name: PHP ${{ matrix.php-versions }} on Ubuntu latest. Experimental == ${{ matrix.experimental }} + name: PHP ${{ matrix.php-versions }} on Ubuntu latest. steps: - name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - name: Checkout - uses: actions/checkout@master + uses: actions/checkout@v6 - name: Install dependencies run: composer install - continue-on-error: ${{ matrix.experimental }} - name: Run CI tests - run: composer check - continue-on-error: ${{ matrix.experimental }} + run: composer check-ci - name: Output log files on failure if: failure() run: tail -2000 /var/log/syslog diff --git a/ci/qa/docheader b/ci/qa/docheader new file mode 100755 index 0000000..fedbc2e --- /dev/null +++ b/ci/qa/docheader @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +cd $(dirname $0)/../../ + +./vendor/bin/docheader --no-ansi check src/ tests/ diff --git a/ci/qa/rector.php b/ci/qa/rector.php new file mode 100644 index 0000000..9d47a74 --- /dev/null +++ b/ci/qa/rector.php @@ -0,0 +1,21 @@ +withPaths([ + __DIR__ . '/../../src', + ]) +// ->withPhpSets() + ->withAttributesSets(all: false) + ->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true) + ->withSkip([ + ClassPropertyAssignToConstructorPromotionRector::class, + RestoreDefaultNullToNullableTypePropertyRector::class, + ]) + ->withPHPStanConfigs([__DIR__.'/phpstan.neon']) + ; diff --git a/ci/qa/rector.sh b/ci/qa/rector.sh new file mode 100755 index 0000000..b2b5857 --- /dev/null +++ b/ci/qa/rector.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +# Ensure we run from project root +cd "$(dirname "$0")/../../" || exit 1 +./vendor/bin/rector --config=ci/qa/rector.php "$@" diff --git a/composer.json b/composer.json index 4661a40..bea8164 100644 --- a/composer.json +++ b/composer.json @@ -25,27 +25,37 @@ "symfony/validator": "^5.4|^6.3" }, "require-dev": { + "malukenho/docheader": "^1.1", "matthiasnoback/symfony-config-test": "^4.0|^v5.0.0", "mockery/mockery": "^1.6", "overtrue/phplint": "*", "phpmd/phpmd": "^2.13", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-symfony": "^1.3", + "phpstan/phpstan": "^2", + "phpstan/phpstan-symfony": "^2", "phpunit/phpunit": "^9.6", + "rector/rector": "^2", "slevomat/coding-standard": "^8.22", "squizlabs/php_codesniffer": "^3.7.1", "symfony/phpunit-bridge": "^5.4|^6.3" }, "scripts": { "check": [ + "@check-ci", + "@rector" + ], + "check-ci": [ "@composer-validate", + "@license-headers", "@phplint", "@phpcs", "@phpmd", "@phpstan", "@test" ], + "license-headers": "./ci/qa/docheader", "composer-validate": "./ci/qa/validate", + "rector": "./ci/qa/rector.sh --dry-run", + "rector-fix": "./ci/qa/rector.sh", "phplint": "./ci/qa/phplint", "phpcs": "./ci/qa/phpcs", "phpmd": "./ci/qa/phpmd", diff --git a/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php index 348f590..6565d06 100644 --- a/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php @@ -2,6 +2,22 @@ declare(strict_types = 1); +/** + * Copyright 2016 SURFnet bv + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace Surfnet\StepupMiddlewareClient\Configuration\Dto; use Assert; diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php index 4cec301..2f8156e 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php @@ -117,8 +117,8 @@ public function setOrderDirection(string $orderDirection): void } /** - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.NPathComplexity") */ public function toHttpQuery(): string { diff --git a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php index 1dc651a..ae7ec79 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php @@ -62,7 +62,10 @@ public function read(string $path, array $parameters = [], ?HttpQuery $httpQuery try { $body = $response->getBody()->getContents(); $data = JsonHelper::decode($body); - $errors = isset($data['errors']) && is_array($data['errors']) ? $data['errors'] : []; + $errors = []; + if (isset($data['errors']) && is_array($data['errors'])) { + $errors = array_filter($data['errors'], is_string(...)); + } } catch (RuntimeException) { // Malformed JSON body throw new MalformedResponseException('Cannot read resource: Middleware returned malformed JSON'); diff --git a/src/Surfnet/StepupMiddlewareClient/Service/CommandService.php b/src/Surfnet/StepupMiddlewareClient/Service/CommandService.php index 38d2c18..a42598b 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/CommandService.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/CommandService.php @@ -38,13 +38,6 @@ class CommandService */ public function __construct(private readonly Client $guzzleClient, string $username, string $password) { - if (!is_string($username)) { - throw InvalidArgumentException::invalidType('string', 'username', $username); - } - - if (!is_string($password)) { - throw InvalidArgumentException::invalidType('string', 'password', $password); - } $this->username = $username; $this->password = $password; } diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Command/AbstractCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Command/AbstractCommand.php index bfcea6e..1b88e37 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Command/AbstractCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Command/AbstractCommand.php @@ -24,7 +24,7 @@ use Surfnet\StepupMiddlewareClientBundle\Exception\InvalidArgumentException; /** - * @SuppressWarnings(PHPMD.NumberOfChildren) since well, we have more than 15 commands + * @SuppressWarnings("PHPMD.NumberOfChildren") since well, we have more than 15 commands */ abstract class AbstractCommand implements Command { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php index 729542b..851d253 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php @@ -3,7 +3,7 @@ declare(strict_types = 1); /** - * Copyright 2022 SURF bv + * Copyright 2022 SURFnet bv * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php index c165945..ecbc1f8 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php @@ -3,7 +3,7 @@ declare(strict_types = 1); /** - * Copyright 2022 SURF bv + * Copyright 2022 SURFnet bv * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php index fd0ec9b..721450e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php @@ -3,7 +3,7 @@ declare(strict_types = 1); /** - * Copyright 2021 SURF bv + * Copyright 2021 SURFnet bv * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaSecondFactorService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaSecondFactorService.php index d223257..7aeabdd 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaSecondFactorService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaSecondFactorService.php @@ -32,7 +32,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class RaSecondFactorService { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php index 70afc8a..33c69a7 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php @@ -41,7 +41,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class SecondFactorService { From 4ce7dcc9f46a2abd974b0c1efd83f1bb268acb14 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 13:41:09 +0100 Subject: [PATCH 04/11] Rector: Migrate to Attributes --- ci/qa/rector.php | 2 +- .../Tests/Helper/JsonHelperTest.php | 4 +- .../Command/AddRaLocationCommand.php | 20 ++++----- .../Command/ChangeRaLocationCommand.php | 20 ++++----- .../Dto/InstitutionConfigurationOptions.php | 36 ++++----------- .../Configuration/Dto/RaLocation.php | 19 ++++---- .../Command/AccreditIdentityCommand.php | 26 +++++------ ...egistrationAuthorityInformationCommand.php | 16 +++---- .../ExpressLocalePreferenceCommand.php | 4 +- .../Identity/Dto/Identity.php | 26 +++++------ .../Identity/Dto/InstitutionListing.php | 4 +- .../Identity/Dto/Profile.php | 24 +++++----- .../Identity/Dto/RaCandidate.php | 20 ++++----- .../Identity/Dto/RaCandidateInstitution.php | 4 +- .../Identity/Dto/RaListing.php | 32 ++++++------- .../Dto/RaSecondFactorExportCollection.php | 3 +- .../Dto/RegistrationAuthorityCredentials.php | 34 ++++---------- .../Identity/Dto/UnverifiedSecondFactor.php | 17 +++---- .../Identity/Dto/VerifiedSecondFactor.php | 45 ++++++------------- .../Identity/Dto/VettedSecondFactor.php | 22 ++++----- ...itutionConfigurationOptionsServiceTest.php | 12 +++-- 21 files changed, 160 insertions(+), 230 deletions(-) diff --git a/ci/qa/rector.php b/ci/qa/rector.php index 9d47a74..52a3783 100644 --- a/ci/qa/rector.php +++ b/ci/qa/rector.php @@ -11,7 +11,7 @@ __DIR__ . '/../../src', ]) // ->withPhpSets() - ->withAttributesSets(all: false) + ->withAttributesSets(all: true) ->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true) ->withSkip([ ClassPropertyAssignToConstructorPromotionRector::class, diff --git a/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php b/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php index caba008..506afbd 100644 --- a/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php +++ b/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php @@ -29,8 +29,8 @@ class JsonHelperTest extends TestCase { /** * @test - * @group json */ + #[\PHPUnit\Framework\Attributes\Group('json')] public function jsonHelperDecodesStringsToArrays(): void { $expectedDecodedResult = ['hello' => 'world']; @@ -41,8 +41,8 @@ public function jsonHelperDecodesStringsToArrays(): void /** * @test - * @group json */ + #[\PHPUnit\Framework\Attributes\Group('json')] public function jsonHelperThrowsAnExceptionWhenThereIsASyntaxError(): void { $this->expectExceptionMessage("Syntax error"); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php index 826a023..872ca7e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php @@ -26,43 +26,43 @@ class AddRaLocationCommand extends AbstractCommand { /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $id; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $institution; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $name; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $location; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $contactInformation; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php index 1705929..408fdf0 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php @@ -26,43 +26,43 @@ class ChangeRaLocationCommand extends AbstractCommand { /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $id; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $institution; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $name; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $location; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $contactInformation; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php index 54dd34c..99e8969 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php @@ -25,49 +25,31 @@ class InstitutionConfigurationOptions implements Dto { - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.use_ra_locations.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.use_ra_locations.must_be_boolean')] public $useRaLocations; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.show_raa_contact_information.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.show_raa_contact_information.must_be_boolean')] public $showRaaContactInformation; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.verify_email.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.verify_email.must_be_boolean')] public $verifyEmail; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.self_vet.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.self_vet.must_be_boolean')] public $selfVet; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.sso_on_2fa.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.sso_on_2fa.must_be_boolean')] public $ssoOn2fa; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.sso_registration_bypass.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.sso_registration_bypass.must_be_boolean')] public $ssoRegistrationBypass; - /** - * @Assert\Type(type="boolean", message="middleware_client.dto.configuration.allow_self_asserted_tokens.must_be_boolean") - */ + #[Assert\Type(type: 'boolean', message: 'middleware_client.dto.configuration.allow_self_asserted_tokens.must_be_boolean')] public $allowSelfAssertedTokens; - /** - * @Assert\Type(type="integer", message="middleware_client.dto.configuration.number_of_tokens_per_identity.must_be_integer") - */ + #[Assert\Type(type: 'integer', message: 'middleware_client.dto.configuration.number_of_tokens_per_identity.must_be_integer')] public $numberOfTokensPerIdentity; - /** - * @Assert\Type(type="array", message="middleware_client.dto.configuration.allowed_second_factors.must_be_array") - */ + #[Assert\Type(type: 'array', message: 'middleware_client.dto.configuration.allowed_second_factors.must_be_array')] public $allowedSecondFactors; public $useRa; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php index 5ed73e0..aa3aac3 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php @@ -26,42 +26,41 @@ class RaLocation implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.ra_location.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_location.id.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.id.must_be_string')] public string $id; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_location.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_location.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_location.name.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_location.name.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.name.must_be_string')] public string $name; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_location.location.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_location.location.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.location.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.location.must_be_string')] public string $location; /** - * @Assert\Type(type="string", message="middleware_client.dto.ra_location.contact_information.must_be_string") - * * @var string */ + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.contact_information.must_be_string')] public string $contactInformation; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php index ef7f7d6..7826bd9 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php @@ -26,52 +26,52 @@ class AccreditIdentityCommand extends AbstractCommand { /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $identityId; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $institution; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") - * @Assert\Choice(choices={"ra", "raa"}) * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] + #[Assert\Choice(choices: ['ra', 'raa'])] public string $role; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $location; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $contactInformation; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $raInstitution; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php index 08e7267..7df7407 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php @@ -26,35 +26,35 @@ class AmendRegistrationAuthorityInformationCommand extends AbstractCommand { /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $identityId; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $location; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $contactInformation; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $raInstitution; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php index 3cc9fb6..bddb062 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php @@ -31,11 +31,11 @@ class ExpressLocalePreferenceCommand extends AbstractCommand public string $identityId; /** - * @Assert\NotBlank() - * @Assert\Type(type="string") * * @var string */ + #[Assert\NotBlank] + #[Assert\Type(type: 'string')] public string $preferredLocale; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php index ef8c33f..873a735 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php @@ -28,45 +28,43 @@ class Identity implements Dto, Serializable, Stringable { - /** - * @Assert\NotBlank(message="middleware_client.dto.identity.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.id.must_be_string") - */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.id.must_be_string')] public ?string $id = null; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.name_id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.name_id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.name_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.name_id.must_be_string')] public string $nameId; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.institution.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.email.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.email.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.email.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.email.must_be_string')] public string $email; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.common_name.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.common_name.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.common_name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.common_name.must_be_string')] public string $commonName; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.preferred_locale.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.preferred_locale.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.preferred_locale.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.preferred_locale.must_be_string')] public string $preferredLocale; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php index 6f90767..8359180 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php @@ -26,11 +26,11 @@ class InstitutionListing implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.institution_listing.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.institution_listing.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.institution_listing.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.institution_listing.institution.must_be_string')] public string $institution; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php index 033fcc6..73f5054 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php @@ -26,45 +26,45 @@ class Profile implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.identity.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.id.must_be_string')] public string $id; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.name_id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.name_id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.name_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.name_id.must_be_string')] public string $nameId; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.institution.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.email.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.email.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.email.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.email.must_be_string')] public string $email; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.common_name.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.common_name.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.common_name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.common_name.must_be_string')] public string $commonName; /** - * @Assert\NotBlank(message="middleware_client.dto.identity.preferred_locale.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.identity.preferred_locale.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.identity.preferred_locale.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.preferred_locale.must_be_string')] public string $preferredLocale; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php index 261ed22..1ffee50 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php @@ -26,43 +26,43 @@ class RaCandidate implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate.identity_id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate.identity_id.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.identity_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.identity_id.must_be_string')] public string $identityId; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate.name_id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate.name_id.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.name_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.name_id.must_be_string')] public string $nameId; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate.common_name.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate.common_name.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.common_name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.common_name.must_be_string')] public string $commonName; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate.email.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate.email.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.email.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.email.must_be_string')] public string $email; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php index ff541b0..4735a77 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php @@ -26,11 +26,11 @@ class RaCandidateInstitution implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.ra_candidate_institution.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_candidate_institution.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate_institution.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate_institution.institution.must_be_string')] public string $institution; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php index f6f13bf..56ebb8e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php @@ -26,67 +26,67 @@ class RaListing implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.id.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.id.must_be_string')] public string $identityId; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.institution.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.institution.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.institution.must_be_string')] public string $raInstitution; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.common_name.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.common_name.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.common_name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.common_name.must_be_string')] public string $commonName; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.email.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.email.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.email.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.email.must_be_string')] public string $email; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.role.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.role.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.role.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.role.must_be_string')] public string $role; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.location.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.location.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.location.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.location.must_be_string')] public string $location; /** - * @Assert\NotBlank(message="middleware_client.dto.ra_listing.contact_information.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.contact_information.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.contact_information.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.contact_information.must_be_string')] public string $contactInformation; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php index 8e1b4bb..0b66181 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php @@ -25,10 +25,9 @@ class RaSecondFactorExportCollection { /** - * @Assert\Valid - * * @var array */ + #[Assert\Valid] protected array $elements; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php index f2def52..b7757b4 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php @@ -26,65 +26,47 @@ class RegistrationAuthorityCredentials implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.ra_credentials.identity_id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.ra_credentials.identity_id.must_be_string") * * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.ra_credentials.identity_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_credentials.identity_id.must_be_string')] public string $identityId; /** - * @Assert\Expression( - * "this.assertNullOrString(value)", - * message="middleware_client.dto.ra_credentials.institution.must_be_null_or_string" - * ) - * * @var string */ + #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.institution.must_be_null_or_string')] public string $institution; /** - * @Assert\Expression( - * "this.assertNullOrString(value)", - * message="middleware_client.dto.ra_credentials.common_name.must_be_null_or_string" - * ) - * * @var string */ + #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.common_name.must_be_null_or_string')] public string $commonName; /** - * @Assert\Expression( - * "this.assertNullOrString(value)", - * message="middleware_client.dto.ra_credentials.location.must_be_null_or_string" - * ) - * * @var string */ + #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.location.must_be_null_or_string')] public string $location; /** - * @Assert\Expression( - * "this.assertNullOrString(value)", - * message="middleware_client.dto.ra_credentials.contact_information.must_be_null_or_string" - * ) - * * @var string */ + #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.contact_information.must_be_null_or_string')] public string $contactInformation; /** - * @Assert\Type(type="bool", message="middleware_client.dto.ra_credentials.is_raa.must_be_boolean") - * * @var bool */ + #[Assert\Type(type: 'bool', message: 'middleware_client.dto.ra_credentials.is_raa.must_be_boolean')] public bool $isRaa; /** - * @Assert\Type(type="bool", message="middleware_client.dto.ra_credentials.is_sraa.must_be_boolean") - * * @var bool */ + #[Assert\Type(type: 'bool', message: 'middleware_client.dto.ra_credentials.is_sraa.must_be_boolean')] public bool $isSraa; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php index e32b387..93681e1 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php @@ -26,29 +26,24 @@ class UnverifiedSecondFactor implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.unverified_second_factor.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.unverified_second_factor.id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.id.must_be_string')] public string $id; /** - * @Assert\NotBlank(message="middleware_client.dto.unverified_second_factor.type.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.unverified_second_factor.type.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.type.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.type.must_be_string')] public string $type; /** - * @Assert\NotBlank( - * message="middleware_client.dto.unverified_second_factor.second_factor_identifier.must_not_be_blank" - * ) - * @Assert\Type( - * type="string", - * message="middleware_client.dto.unverified_second_factor.second_factor_identifier.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.second_factor_identifier.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php index 8ab512a..8a496fa 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php @@ -27,39 +27,31 @@ class VerifiedSecondFactor implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.verified_second_factor.id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.id.must_be_string')] public string $id; /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.type.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.verified_second_factor.type.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.type.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.type.must_be_string')] public string $type; /** - * @Assert\NotBlank( - * message="middleware_client.dto.verified_second_factor.second_factor_identifier.must_not_be_blank" - * ) - * @Assert\Type( - * type="string", - * message="middleware_client.dto.verified_second_factor.second_factor_identifier.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.second_factor_identifier.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.registration_code.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.verified_second_factor.registration_code.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.registration_code.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.registration_code.must_be_string')] public string $registrationCode; @@ -69,33 +61,24 @@ class VerifiedSecondFactor implements Dto public DateTime $registrationRequestedAt; /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.identity_id.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.verified_second_factor.identity_id.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.identity_id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.identity_id.must_be_string')] public string $identityId; /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.institution.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.verified_second_factor.institution.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.institution.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.institution.must_be_string')] public string $institution; /** - * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.common_name.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.verified_second_factor.common_name.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.common_name.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.common_name.must_be_string')] public string $commonName; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php index 7eb7bd1..ca77483 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php @@ -26,37 +26,31 @@ class VettedSecondFactor implements Dto { /** - * @Assert\NotBlank(message="middleware_client.dto.vetted_second_factor.id.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.vetted_second_factor.id.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.id.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.id.must_be_string')] public string $id; /** - * @Assert\NotBlank(message="middleware_client.dto.vetted_second_factor.type.must_not_be_blank") - * @Assert\Type(type="string", message="middleware_client.dto.vetted_second_factor.type.must_be_string") * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.type.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.type.must_be_string')] public string $type; /** - * @Assert\NotBlank(message="middleware_client.dto.vetted_second_factor.second_factor_identifier.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.vetted_second_factor.second_factor_identifier.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.second_factor_identifier.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; /** - * @Assert\NotBlank(message="middleware_client.dto.vetted_second_factor.vetting_typ.must_not_be_blank") - * @Assert\Type( - * type="string", - * message="middleware_client.dto.vetted_second_factor.veting_type.must_be_string" - * ) * @var string */ + #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.vetting_typ.must_not_be_blank')] + #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.veting_type.must_be_string')] public string $vettingType; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php index c0d4974..6047254 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php @@ -33,9 +33,7 @@ protected function tearDown(): void Mockery::close(); } - /** - * @group institution-configuration - */ + #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] public function testQueriedInstitutionConfigurationOptionsAreConvertedToADtoCorrectly(): void { $institution = 'surfnet.nl'; @@ -90,11 +88,11 @@ public function testQueriedInstitutionConfigurationOptionsAreConvertedToADtoCorr } /** - * @group institution-configuration * * @dataProvider nonBooleanProvider * @param array|string|int|float|stdClass|null $nonBoolean */ + #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocationsOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void { $institution = 'surfnet.nl'; @@ -141,11 +139,11 @@ public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocations } /** - * @group institution-configuration * * @dataProvider nonBooleanProvider * @param array|string|int|float|stdClass|null $nonBoolean */ + #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContactInformationOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void { $institution = 'surfnet.nl'; @@ -192,11 +190,11 @@ public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContact } /** - * @group institution-configuration * * @dataProvider nonArrayProvider * @param bool|string|int|float|stdClass|null $nonArray */ + #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFactorsAreInvalid(null|bool|string|int|float|stdClass $nonArray): void { $institution = 'surfnet.nl'; @@ -243,11 +241,11 @@ public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFac } /** - * @group institution-configuration * * @dataProvider nonStringProvider * @param bool|array|int|float|stdClass|null $nonArray */ + #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] public function testInstitutionConfigurationOptionsWithANonStringsAllowedSecondFactorsAreInvalid(null|bool|array|int|float|stdClass $nonArray): void { $institution = 'surfnet.nl'; From dfd1ae58f126ffaeb945c37431b298caa0de1585 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 13:46:09 +0100 Subject: [PATCH 05/11] Rector: Readonly & FunctionFirstClassCallableRector --- ci/qa/rector.php | 2 +- .../Identity/Dto/SecondFactorAuditLogSearchQuery.php | 6 +++--- src/Surfnet/StepupMiddlewareClient/Service/ApiService.php | 2 +- .../StepupMiddlewareClient/Service/ExecutionResult.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/qa/rector.php b/ci/qa/rector.php index 52a3783..551ee69 100644 --- a/ci/qa/rector.php +++ b/ci/qa/rector.php @@ -10,7 +10,7 @@ ->withPaths([ __DIR__ . '/../../src', ]) -// ->withPhpSets() + ->withPhpSets() ->withAttributesSets(all: true) ->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true) ->withSkip([ diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php index 19a38ca..72547bd 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php @@ -28,12 +28,12 @@ final class SecondFactorAuditLogSearchQuery implements HttpQuery /** * @var string */ - private string $institution; + private readonly string $institution; /** * @var string */ - private string $identityId; + private readonly string $identityId; private string $orderBy = 'recordedOn'; @@ -45,7 +45,7 @@ final class SecondFactorAuditLogSearchQuery implements HttpQuery /** * @var int */ - private int $pageNumber; + private readonly int $pageNumber; /** * @param string $institution diff --git a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php index ae7ec79..63d118f 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php @@ -97,7 +97,7 @@ public function read(string $path, array $parameters = [], ?HttpQuery $httpQuery */ private function buildResourcePath(string $path, array $parameters, ?HttpQuery $httpQuery = null): string { - $resource = $parameters !== [] ? vsprintf($path, array_map('urlencode', $parameters)) : $path; + $resource = $parameters !== [] ? vsprintf($path, array_map(urlencode(...), $parameters)) : $path; if (empty($resource)) { throw new RuntimeException( diff --git a/src/Surfnet/StepupMiddlewareClient/Service/ExecutionResult.php b/src/Surfnet/StepupMiddlewareClient/Service/ExecutionResult.php index 6f54fa8..6d1b0f5 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/ExecutionResult.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/ExecutionResult.php @@ -26,7 +26,7 @@ class ExecutionResult * @param string|null $uuid Null in case of errors. * @param string|null $processedBy Null in case of errors. */ - public function __construct(private ?string $uuid, private ?string $processedBy, private readonly array $errors = []) + public function __construct(private readonly ?string $uuid, private readonly ?string $processedBy, private readonly array $errors = []) { } From 980c0ec63278a27b1c0a9f9e590bb94531387981 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 13:59:50 +0100 Subject: [PATCH 06/11] Update PHPUnit 9 > 10 --- ci/qa/phpunit | 2 +- ci/qa/phpunit.xml | 45 +++++++++---------- composer.json | 2 +- .../Tests/Helper/JsonHelperTest.php | 8 +--- .../Tests/Service/CommandServiceTest.php | 12 ++--- ...itutionConfigurationOptionsServiceTest.php | 14 +++--- .../Tests/Service/CommandServiceTest.php | 4 +- 7 files changed, 37 insertions(+), 50 deletions(-) diff --git a/ci/qa/phpunit b/ci/qa/phpunit index 0ac602f..027672c 100755 --- a/ci/qa/phpunit +++ b/ci/qa/phpunit @@ -4,4 +4,4 @@ cd $(dirname $0)/../../ # PHPUnit Bridge should always be used in Symfony applications. (https://symfony.com/doc/current/components/phpunit_bridge.html) # This will create a phpunit executable in /bin/ instead of /vendor/bin/ -./vendor/bin/phpunit -c ci/qa/phpunit.xml +./vendor/bin/phpunit -c ci/qa/phpunit.xml $@ diff --git a/ci/qa/phpunit.xml b/ci/qa/phpunit.xml index 5c04cf8..9e2a286 100644 --- a/ci/qa/phpunit.xml +++ b/ci/qa/phpunit.xml @@ -1,33 +1,28 @@ - - - - - - - - ../../src/Surfnet/StepupMiddlewareClient/Tests - ../../src/Surfnet/StepupMiddlewareClientBundle/Tests - - - - - - ../../src - - - ../../src/Surfnet/StepupMiddlewareClient/Tests - ../../src/Surfnet/StepupMiddlewareClientBundle/Tests - - - - - + + + + + + + ../../src/Surfnet/StepupMiddlewareClient/Tests + ../../src/Surfnet/StepupMiddlewareClientBundle/Tests + + + + + ../../src + + + ../../src/Surfnet/StepupMiddlewareClient/Tests + ../../src/Surfnet/StepupMiddlewareClientBundle/Tests + + diff --git a/composer.json b/composer.json index bea8164..1445970 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpmd/phpmd": "^2.13", "phpstan/phpstan": "^2", "phpstan/phpstan-symfony": "^2", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.5", "rector/rector": "^2", "slevomat/coding-standard": "^8.22", "squizlabs/php_codesniffer": "^3.7.1", diff --git a/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php b/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php index 506afbd..4455f4f 100644 --- a/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php +++ b/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php @@ -27,10 +27,8 @@ class JsonHelperTest extends TestCase { - /** - * @test - */ #[\PHPUnit\Framework\Attributes\Group('json')] + #[\PHPUnit\Framework\Attributes\Test] public function jsonHelperDecodesStringsToArrays(): void { $expectedDecodedResult = ['hello' => 'world']; @@ -39,10 +37,8 @@ public function jsonHelperDecodesStringsToArrays(): void $this->assertSame($expectedDecodedResult, $actualDecodedResult); } - /** - * @test - */ #[\PHPUnit\Framework\Attributes\Group('json')] + #[\PHPUnit\Framework\Attributes\Test] public function jsonHelperThrowsAnExceptionWhenThereIsASyntaxError(): void { $this->expectExceptionMessage("Syntax error"); diff --git a/src/Surfnet/StepupMiddlewareClient/Tests/Service/CommandServiceTest.php b/src/Surfnet/StepupMiddlewareClient/Tests/Service/CommandServiceTest.php index a5af965..e97f80a 100644 --- a/src/Surfnet/StepupMiddlewareClient/Tests/Service/CommandServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClient/Tests/Service/CommandServiceTest.php @@ -35,9 +35,7 @@ protected function tearDown(): void m::close(); } - /** - * @dataProvider commandMetadata - */ + #[\PHPUnit\Framework\Attributes\DataProvider('commandMetadata')] public function testItExecutesCommands(bool $shouldHaveMeta, array $metadata): void { $uuid = 'uu-id'; @@ -78,7 +76,7 @@ public function testItExecutesCommands(bool $shouldHaveMeta, array $metadata): v $this->assertEquals($command->getProcessedBy(), $processedBy); } - public function commandMetadata(): array + public static function commandMetadata(): array { return [ 'No metadata' => [false, []], @@ -145,9 +143,7 @@ public function testItThrowsWhenMalformedJsonIsReturned(): void $service->execute($commandName, $uuid, $payload); } - /** - * @dataProvider invalidResponses - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invalidResponses')] public function testItThrowsWhenInvalidResponseIsReturned(int $statusCode, array $response): void { $json = json_encode($response, JSON_THROW_ON_ERROR); @@ -170,7 +166,7 @@ public function testItThrowsWhenInvalidResponseIsReturned(int $statusCode, array $service->execute($commandName, $uuid, $payload); } - public function invalidResponses(): array + public static function invalidResponses(): array { return [ '200, missing command' => [200, ['processed_by' => 'server-3']], diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php index 6047254..7b6cb87 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php @@ -89,10 +89,10 @@ public function testQueriedInstitutionConfigurationOptionsAreConvertedToADtoCorr /** * - * @dataProvider nonBooleanProvider * @param array|string|int|float|stdClass|null $nonBoolean */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] + #[\PHPUnit\Framework\Attributes\DataProvider('nonBooleanProvider')] public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocationsOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void { $institution = 'surfnet.nl'; @@ -140,10 +140,10 @@ public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocations /** * - * @dataProvider nonBooleanProvider * @param array|string|int|float|stdClass|null $nonBoolean */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] + #[\PHPUnit\Framework\Attributes\DataProvider('nonBooleanProvider')] public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContactInformationOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void { $institution = 'surfnet.nl'; @@ -191,10 +191,10 @@ public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContact /** * - * @dataProvider nonArrayProvider * @param bool|string|int|float|stdClass|null $nonArray */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] + #[\PHPUnit\Framework\Attributes\DataProvider('nonArrayProvider')] public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFactorsAreInvalid(null|bool|string|int|float|stdClass $nonArray): void { $institution = 'surfnet.nl'; @@ -242,10 +242,10 @@ public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFac /** * - * @dataProvider nonStringProvider * @param bool|array|int|float|stdClass|null $nonArray */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] + #[\PHPUnit\Framework\Attributes\DataProvider('nonStringProvider')] public function testInstitutionConfigurationOptionsWithANonStringsAllowedSecondFactorsAreInvalid(null|bool|array|int|float|stdClass $nonArray): void { $institution = 'surfnet.nl'; @@ -291,7 +291,7 @@ public function testInstitutionConfigurationOptionsWithANonStringsAllowedSecondF $service->getInstitutionConfigurationOptionsFor($institution); } - public function nonBooleanProvider(): array + public static function nonBooleanProvider(): array { return [ 'null' => [null], @@ -303,7 +303,7 @@ public function nonBooleanProvider(): array ]; } - public function nonArrayProvider(): array + public static function nonArrayProvider(): array { return [ 'null' => [null], @@ -315,7 +315,7 @@ public function nonArrayProvider(): array ]; } - public function nonStringProvider(): array + public static function nonStringProvider(): array { return [ 'null' => [null], diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php index 5829062..353529d 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php @@ -39,13 +39,13 @@ protected function tearDown(): void } /** - * @dataProvider commands * @param string $expectedCommandName * @param array $expectedPayload * @param array $expectedMetadataPayload * @param Command $command * @param Metadata $metadata */ + #[\PHPUnit\Framework\Attributes\DataProvider('commands')] public function testItExecutesCommands( string $expectedCommandName, array $expectedPayload, @@ -70,7 +70,7 @@ public function testItExecutesCommands( $this->assertEquals($sentUuid, $command->getUuid(), 'UUID set doesn\'t match the UUID sent'); } - public function commands(): array + public static function commands(): array { return [ 'Non-nested command' => [ From 70dc4ec6fe54c7592d040c66668a1fe25f04cc62 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 14:11:33 +0100 Subject: [PATCH 07/11] Symfony 6.3 > 7.4 --- .gitignore | 3 ++- ci/qa/phplint.yaml | 2 +- ci/qa/phpunit.xml | 2 +- composer.json | 26 +++++++++---------- ...InstitutionConfigurationOptionsService.php | 6 ++--- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index e7f65e8..f8b120d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .idea/ composer.lock /cache.properties -.phpunit.result.cache +var/cache/ +var/qa/ diff --git a/ci/qa/phplint.yaml b/ci/qa/phplint.yaml index f07ad6c..1cc9bd1 100644 --- a/ci/qa/phplint.yaml +++ b/ci/qa/phplint.yaml @@ -1,6 +1,6 @@ path: [./src, ./tests] jobs: 10 -cache: /var/qa/phplint.cache +cache-dir: var/cache/qa/phplint.cache extensions: - php exclude: diff --git a/ci/qa/phpunit.xml b/ci/qa/phpunit.xml index 9e2a286..74a487d 100644 --- a/ci/qa/phpunit.xml +++ b/ci/qa/phpunit.xml @@ -4,7 +4,7 @@ backupGlobals="false" colors="true" bootstrap="../../vendor/autoload.php" - cacheDirectory="../../var/qa/phpunit.cache" + cacheDirectory="../../var/cache/qa/phpunit.cache" > diff --git a/composer.json b/composer.json index 1445970..3bb8568 100644 --- a/composer.json +++ b/composer.json @@ -10,33 +10,33 @@ } }, "require": { - "php": "^8.1", - "beberlei/assert": "~2.0", - "brick/math": "^0.11.0", + "php": "^8.2", + "beberlei/assert": "^3.3", + "brick/math": "^0.14.1", "guzzlehttp/guzzle": "^7.8", "psr/log": "^3.0", "ramsey/uuid": "^4.7", "surfnet/stepup-bundle": "^7.0.1", "surfnet/stepup-saml-bundle": "^7.0.1", - "symfony/config": "^5.4|^6.3", - "symfony/dependency-injection": "^5.4|^6.3", - "symfony/framework-bundle": "^5.4|^6.3", - "symfony/http-kernel": "^5.4|^6.3", - "symfony/validator": "^5.4|^6.3" + "symfony/config": "^6.4|^7.4", + "symfony/dependency-injection": "^6.4|^7.4", + "symfony/framework-bundle": "^6.4|^7.4", + "symfony/http-kernel": "^6.4|^7.4", + "symfony/validator": "^6.4|^7.4" }, "require-dev": { "malukenho/docheader": "^1.1", - "matthiasnoback/symfony-config-test": "^4.0|^v5.0.0", + "matthiasnoback/symfony-config-test": "^6.1", "mockery/mockery": "^1.6", - "overtrue/phplint": "*", + "overtrue/phplint": "^9.7.1", "phpmd/phpmd": "^2.13", "phpstan/phpstan": "^2", "phpstan/phpstan-symfony": "^2", "phpunit/phpunit": "^10.5", "rector/rector": "^2", - "slevomat/coding-standard": "^8.22", - "squizlabs/php_codesniffer": "^3.7.1", - "symfony/phpunit-bridge": "^5.4|^6.3" + "slevomat/coding-standard": "^8.26", + "squizlabs/php_codesniffer": "^4.0", + "symfony/phpunit-bridge": "^6.4|^7.4" }, "scripts": { "check": [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php index 0cde885..8422b70 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php @@ -26,11 +26,11 @@ use Surfnet\StepupMiddlewareClientBundle\Exception\InvalidResponseException; use Symfony\Component\Validator\Validator\ValidatorInterface; -final class InstitutionConfigurationOptionsService +final readonly class InstitutionConfigurationOptionsService { public function __construct( - private readonly LibraryInstitutionConfigurationOptionsService $service, - private readonly ValidatorInterface $validator + private LibraryInstitutionConfigurationOptionsService $service, + private ValidatorInterface $validator ) { } From 94bd9963b034df8973406328cf12b27306702d8b Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 14:19:59 +0100 Subject: [PATCH 08/11] Update PHPUnit 10 > 11 --- ci/qa/phpunit.xml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/qa/phpunit.xml b/ci/qa/phpunit.xml index 74a487d..d76918c 100644 --- a/ci/qa/phpunit.xml +++ b/ci/qa/phpunit.xml @@ -1,6 +1,6 @@ Date: Tue, 13 Jan 2026 14:47:31 +0100 Subject: [PATCH 09/11] Mark project as library --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 374aec3..c23cad9 100644 --- a/composer.json +++ b/composer.json @@ -69,5 +69,6 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } - } + }, + "type": "library" } From 4e51326e567e315c7e1b8ab0c58344703094860d Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Tue, 13 Jan 2026 15:13:23 +0100 Subject: [PATCH 10/11] Update release notes --- CHANGELOG.md | 5 +++++ README.md | 2 +- composer.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f506d4d..873e46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 6.0.0 +- Add support for Symfony 7.4 +- Drop support for Symfony 5.4 +- Minimal PHP version bumped to 8.2 + ## 5.3.0 - Add SSO registration bypass field to the institution configuration - diff --git a/README.md b/README.md index 2f9ebd6..05669f8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Step-up Middleware Client Bundle [![Build status](https://github.com/OpenConext/Stepup-Middleware-clientbundle/actions/workflows/test-integration.yml/badge.svg)](https://github.com/OpenConext/Stepup-Middleware-clientbundle/actions/workflows/test-integration.yml) -A Symfony 6 bundle to consume the Step-up Middleware API. See [Stepup-Deploy](https://github.com/OpenConext/Stepup-Deploy) for an overview. +A Symfony bundle to consume the Step-up Middleware API. See [Stepup-Deploy](https://github.com/OpenConext/Stepup-Deploy) for an overview. ## Requirements diff --git a/composer.json b/composer.json index c23cad9..003e529 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "surfnet/stepup-middleware-client-bundle", - "description": "Symfony 5|6 bundle for consuming the Step-up Middleware API.", + "description": "Symfony bundle for consuming the Step-up Middleware API.", "license": "Apache-2.0", "minimum-stability": "stable", "autoload": { From 9eb0c5e505d73f9243215236ef86d71b43489c65 Mon Sep 17 00:00:00 2001 From: Johan Kromhout Date: Thu, 15 Jan 2026 16:12:11 +0100 Subject: [PATCH 11/11] Cleanup useless typehints Have rector cleanup all redundant typehints in comments where the type is already specified by a native php hint --- ci/qa/rector.php | 1 + .../Dto/RaLocationSearchQuery.php | 3 -- .../Service/RaLocationService.php | 1 - .../StepupMiddlewareClient/Dto/HttpQuery.php | 2 - .../AccessDeniedToResourceException.php | 2 - .../Exception/InvalidArgumentException.php | 1 - .../Exception/ResourceReadException.php | 1 - .../Identity/Dto/RaListingSearchQuery.php | 29 -------------- .../Dto/RaSecondFactorExportQuery.php | 23 ----------- .../Dto/RaSecondFactorSearchQuery.php | 21 ---------- .../Identity/Dto/RecoveryToken.php | 24 ------------ .../Identity/Dto/RecoveryTokenSearchQuery.php | 3 -- .../Dto/SecondFactorAuditLogSearchQuery.php | 22 ----------- .../Dto/UnverifiedSecondFactorSearchQuery.php | 3 -- ...ifiedSecondFactorOfIdentitySearchQuery.php | 3 -- .../Dto/VettedSecondFactorSearchQuery.php | 3 -- .../Identity/Dto/VettingTypeHint.php | 8 ---- .../Identity/Service/IdentityService.php | 6 --- .../Identity/Service/RaService.php | 4 -- .../Identity/Service/SecondFactorService.php | 8 ---- .../Service/ApiService.php | 5 --- .../Command/Command.php | 7 ---- .../Command/Metadata.php | 3 -- .../Command/AddRaLocationCommand.php | 20 ---------- .../Command/ChangeRaLocationCommand.php | 20 ---------- .../Command/RemoveRaLocationCommand.php | 9 ----- .../Dto/InstitutionConfigurationOptions.php | 4 -- .../Configuration/Dto/RaLocation.php | 19 --------- ...InstitutionConfigurationOptionsService.php | 3 -- .../Service/RaLocationService.php | 8 ---- .../Dto/CollectionDto.php | 3 -- .../Exception/InvalidArgumentException.php | 1 - .../Exception/InvalidResponseException.php | 3 -- .../Command/AccreditIdentityCommand.php | 27 ------------- ...egistrationAuthorityInformationCommand.php | 19 --------- .../Identity/Command/AppointRoleCommand.php | 9 ----- .../Command/CreateIdentityCommand.php | 18 --------- .../ExpressLocalePreferenceCommand.php | 10 ----- ...eSafeStoreSecretTokenPossessionCommand.php | 6 --- .../Command/ProveGssfPossessionCommand.php | 3 -- .../Command/ProvePhonePossessionCommand.php | 7 ---- ...ovePhoneRecoveryTokenPossessionCommand.php | 7 ---- .../ProveU2fDevicePossessionCommand.php | 6 --- .../Command/ProveYubikeyPossessionCommand.php | 6 --- ...egisterSelfAssertedSecondFactorCommand.php | 21 ---------- .../RetractRegistrationAuthorityCommand.php | 6 --- .../Command/RevokeOwnRecoveryTokenCommand.php | 9 ----- .../Command/RevokeOwnSecondFactorCommand.php | 9 ----- .../RevokeRegistrantsRecoveryTokenCommand.php | 12 ------ .../RevokeRegistrantsSecondFactorCommand.php | 12 ------ .../Command/SaveVettingTypeHintCommand.php | 6 --- .../Command/SelfVetSecondFactorCommand.php | 21 ---------- ...ndSecondFactorRegistrationEmailCommand.php | 6 --- .../Command/UpdateIdentityCommand.php | 10 ----- .../Identity/Command/VerifyEmailCommand.php | 6 --- .../Command/VetSecondFactorCommand.php | 27 ------------- .../Identity/Dto/AuditLogEntry.php | 39 ------------------- .../Identity/Dto/Identity.php | 17 -------- .../Identity/Dto/InstitutionListing.php | 4 -- .../Identity/Dto/Profile.php | 24 ------------ .../Identity/Dto/RaCandidate.php | 20 ---------- .../Identity/Dto/RaCandidateInstitution.php | 4 -- .../Identity/Dto/RaCandidateInstitutions.php | 6 --- .../Identity/Dto/RaListing.php | 32 --------------- .../Identity/Dto/RaListingCollection.php | 1 - .../Dto/RaSecondFactorExportCollection.php | 6 --- .../Dto/RegistrationAuthorityCredentials.php | 22 ----------- .../Identity/Dto/UnverifiedSecondFactor.php | 9 ----- .../Identity/Dto/VerifiedSecondFactor.php | 24 ------------ .../Identity/Dto/VettedSecondFactor.php | 13 ------- .../Service/InstitutionListingService.php | 3 -- .../Identity/Service/ProfileService.php | 5 --- .../Identity/Service/RaCandidateService.php | 3 -- .../Identity/Service/RaListingService.php | 4 -- .../Identity/Service/RaService.php | 5 --- .../Identity/Service/SecondFactorService.php | 6 --- ...itutionConfigurationOptionsServiceTest.php | 16 -------- .../Tests/Service/CommandServiceTest.php | 7 ---- .../Fixtures/Root/Command/CauseCommand.php | 3 -- .../Root/Command/Name/Spaced/ZigCommand.php | 3 -- .../Uuid/Uuid.php | 3 -- 81 files changed, 1 insertion(+), 814 deletions(-) diff --git a/ci/qa/rector.php b/ci/qa/rector.php index 551ee69..aee2d26 100644 --- a/ci/qa/rector.php +++ b/ci/qa/rector.php @@ -18,4 +18,5 @@ RestoreDefaultNullToNullableTypePropertyRector::class, ]) ->withPHPStanConfigs([__DIR__.'/phpstan.neon']) + ->withPreparedSets(deadCode: true) ; diff --git a/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php index 6565d06..072b435 100644 --- a/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php @@ -38,9 +38,6 @@ public function __construct(string $institution) $this->institution = $institution; } - /** - * @return string - */ public function getInstitution(): string { return $this->institution; diff --git a/src/Surfnet/StepupMiddlewareClient/Configuration/Service/RaLocationService.php b/src/Surfnet/StepupMiddlewareClient/Configuration/Service/RaLocationService.php index a2bdb69..37d9e33 100644 --- a/src/Surfnet/StepupMiddlewareClient/Configuration/Service/RaLocationService.php +++ b/src/Surfnet/StepupMiddlewareClient/Configuration/Service/RaLocationService.php @@ -34,7 +34,6 @@ public function __construct(private readonly ApiService $apiService) /** * @param string $id The RA's locations ID. - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. diff --git a/src/Surfnet/StepupMiddlewareClient/Dto/HttpQuery.php b/src/Surfnet/StepupMiddlewareClient/Dto/HttpQuery.php index 79fc243..7d1926a 100644 --- a/src/Surfnet/StepupMiddlewareClient/Dto/HttpQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Dto/HttpQuery.php @@ -24,8 +24,6 @@ interface HttpQuery { /** * Return the Http Query string as should be used, MUST include the '?' prefix. - * - * @return string */ public function toHttpQuery(): string; } diff --git a/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php b/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php index d81480c..b4fc9e6 100644 --- a/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php +++ b/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php @@ -25,10 +25,8 @@ class AccessDeniedToResourceException extends RuntimeException implements ApiErrorException { /** - * @param string $resource * @param string[] $errors * @param int $code - * @param null|Exception $previous */ public function __construct(string $resource, private readonly array $errors, $code = 0, ?Exception $previous = null) { diff --git a/src/Surfnet/StepupMiddlewareClient/Exception/InvalidArgumentException.php b/src/Surfnet/StepupMiddlewareClient/Exception/InvalidArgumentException.php index 98a44c7..5bce5b5 100644 --- a/src/Surfnet/StepupMiddlewareClient/Exception/InvalidArgumentException.php +++ b/src/Surfnet/StepupMiddlewareClient/Exception/InvalidArgumentException.php @@ -26,7 +26,6 @@ class InvalidArgumentException extends \InvalidArgumentException implements Step * @param string $expected description of expected type * @param $parameterName * @param mixed $parameter the parameter that is not of the expected type. - * @return self */ public static function invalidType(string $expected, $parameterName, mixed $parameter): self { diff --git a/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php b/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php index a035d61..ac35f0c 100644 --- a/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php +++ b/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php @@ -27,7 +27,6 @@ class ResourceReadException extends RuntimeException implements ApiErrorExceptio /** * @param string[] $errors * @param int $code - * @param null|Exception $previous */ public function __construct(string $message, private readonly array $errors, $code = 0, ?Exception $previous = null) { diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php index d8281ee..e08b620 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php @@ -36,10 +36,6 @@ final class RaListingSearchQuery implements HttpQuery private string $orderBy = 'commonName'; private ?string $orderDirection = 'asc'; - /** - * @param string $actorId - * @param int $pageNumber - */ public function __construct(string $actorId, int $pageNumber) { $this->assertNonEmptyString($actorId, 'actorId'); @@ -52,7 +48,6 @@ public function __construct(string $actorId, int $pageNumber) } /** - * @param string $institution * @return $this */ public function setInstitution(string $institution): self @@ -64,10 +59,6 @@ public function setInstitution(string $institution): self return $this; } - /** - * @param string $identityId - * @return RaListingSearchQuery - */ public function setIdentityId(string $identityId): self { $this->assertNonEmptyString($identityId, 'identityId'); @@ -86,10 +77,6 @@ public function setOrderBy(string $orderBy): self return $this; } - /** - * @param string|null $orderDirection - * @return RaListingSearchQuery - */ public function setOrderDirection(?string $orderDirection): self { Assert\that($orderDirection)->choice( @@ -102,10 +89,6 @@ public function setOrderDirection(?string $orderDirection): self return $this; } - /** - * @param string $name - * @return RaListingSearchQuery - */ public function setName(string $name): self { $this->assertNonEmptyString($name, 'name'); @@ -113,10 +96,6 @@ public function setName(string $name): self return $this; } - /** - * @param string $email - * @return RaListingSearchQuery - */ public function setEmail(string $email): self { $this->assertNonEmptyString($email, 'email'); @@ -124,10 +103,6 @@ public function setEmail(string $email): self return $this; } - /** - * @param string $role - * @return RaListingSearchQuery - */ public function setRole(string $role): self { $this->assertNonEmptyString($role, 'role'); @@ -135,10 +110,6 @@ public function setRole(string $role): self return $this; } - /** - * @param string $raInstitution - * @return RaListingSearchQuery - */ public function setRaInstitution(string $raInstitution): self { $this->assertNonEmptyString($raInstitution, 'raInstitution'); diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorExportQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorExportQuery.php index ca9a8d1..0aa401e 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorExportQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorExportQuery.php @@ -73,9 +73,6 @@ public function getFileName(): string return $fileName; } - /** - * @return null|string - */ public function getName(): ?string { return $this->name; @@ -86,9 +83,6 @@ public function setName(string $name): void $this->name = $name; } - /** - * @return null|string - */ public function getType(): ?string { return $this->type; @@ -99,9 +93,6 @@ public function setType(string $type): void $this->type = $type; } - /** - * @return null|string - */ public function getSecondFactorId(): ?string { return $this->secondFactorId; @@ -112,9 +103,6 @@ public function setSecondFactorId(string $secondFactorId): void $this->secondFactorId = $secondFactorId; } - /** - * @return null|string - */ public function getEmail(): ?string { return $this->email; @@ -125,9 +113,6 @@ public function setEmail(string $email): void $this->email = $email; } - /** - * @return null|string - */ public function getInstitution(): ?string { return $this->institution; @@ -138,9 +123,6 @@ public function setInstitution(string $institution): void $this->institution = $institution; } - /** - * @return null|string - */ public function getStatus(): ?string { return $this->status; @@ -156,9 +138,6 @@ public function setStatus(string $status): void $this->status = $status ?: null; } - /** - * @param string $orderBy - */ public function setOrderBy(string $orderBy): void { $this->assertNonEmptyString($orderBy, 'orderBy'); @@ -189,8 +168,6 @@ private function assertNonEmptyString(string $value, string $name): void /** * Return the Http Query string as should be used, MUST include the '?' prefix. - * - * @return string */ public function toHttpQuery(): string { diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorSearchQuery.php index bf1cb43..0d47391 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorSearchQuery.php @@ -39,10 +39,6 @@ final class RaSecondFactorSearchQuery implements HttpQuery private ?string $orderBy = null; private ?string $orderDirection = null; - /** - * @param int $pageNumber - * @param string $actorId - */ public function __construct(private int $pageNumber, private string $actorId) { Assert\that($pageNumber) @@ -60,9 +56,6 @@ public function setActorId(string $actorId): self return $this; } - /** - * @return null|string - */ public function getName(): ?string { return $this->name; @@ -73,9 +66,6 @@ public function setName(string $name): void $this->name = $name; } - /** - * @return null|string - */ public function getType(): ?string { return $this->type; @@ -96,9 +86,6 @@ public function setSecondFactorId(string $secondFactorId): void $this->secondFactorId = $secondFactorId; } - /** - * @return null|string - */ public function getEmail(): ?string { return $this->email; @@ -110,9 +97,6 @@ public function setEmail(string $email): void $this->email = $email; } - /** - * @return null|string - */ public function getStatus(): ?string { return $this->status; @@ -128,9 +112,6 @@ public function setStatus(string $status): void $this->status = $status ?: null; } - /** - * @return null|string - */ public function getInstitution(): ?string { return $this->institution; @@ -171,8 +152,6 @@ private function assertNonEmptyString(string $value, string $name): void /** * Return the Http Query string as should be used, MUST include the '?' prefix. - * - * @return string */ public function toHttpQuery(): string { diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryToken.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryToken.php index b80ddfb..080ca88 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryToken.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryToken.php @@ -22,44 +22,20 @@ final class RecoveryToken { - /** - * @var string - */ public string $recoveryTokenId; - /** - * @var string - */ public string $type; - /** - * @var string - */ public string $identifier; - /** - * @var string - */ public string $status; - /** - * @var string - */ public string $name; - /** - * @var string - */ public string $institution; - /** - * @var string - */ public string $email; - /** - * @var string - */ public string $identityId; public static function from(array $apiResult): self diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php index 2f8156e..a4f6a4b 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RecoveryTokenSearchQuery.php @@ -50,9 +50,6 @@ public function __construct(private int $pageNumber, private string $actorId) private ?string $orderBy = null; - /** - * @var string|null - */ private ?string $orderDirection = null; public function setActorId(string $actorId): self diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php index 72547bd..b3b756e 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php @@ -25,33 +25,16 @@ final class SecondFactorAuditLogSearchQuery implements HttpQuery { - /** - * @var string - */ private readonly string $institution; - /** - * @var string - */ private readonly string $identityId; private string $orderBy = 'recordedOn'; - /** - * @var string|null - */ private ?string $orderDirection = 'desc'; - /** - * @var int - */ private readonly int $pageNumber; - /** - * @param string $institution - * @param string $identityId - * @param int $pageNumber - */ public function __construct(string $institution, string $identityId, int $pageNumber) { $this->assertNonEmptyString($institution, 'institution'); @@ -72,9 +55,6 @@ public function setOrderBy(string $orderBy): void $this->orderBy = $orderBy; } - /** - * @param string|null $orderDirection - */ public function setOrderDirection(?string $orderDirection): void { Assert\that($orderDirection)->choice( @@ -98,8 +78,6 @@ private function assertNonEmptyString(string $value, string $name): void /** * Return the Http Query string as should be used, MUST include the '?' prefix. - * - * @return string */ public function toHttpQuery(): string { diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/UnverifiedSecondFactorSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/UnverifiedSecondFactorSearchQuery.php index 53697a4..581106e 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/UnverifiedSecondFactorSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/UnverifiedSecondFactorSearchQuery.php @@ -27,9 +27,6 @@ class UnverifiedSecondFactorSearchQuery implements HttpQuery { private ?string $identityId = null; - /** - * @var string|null - */ private ?string $verificationNonce = null; public function setIdentityId(string $identityId): static diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VerifiedSecondFactorOfIdentitySearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VerifiedSecondFactorOfIdentitySearchQuery.php index ed293ae..c7165d3 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VerifiedSecondFactorOfIdentitySearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VerifiedSecondFactorOfIdentitySearchQuery.php @@ -25,9 +25,6 @@ class VerifiedSecondFactorOfIdentitySearchQuery implements HttpQuery { - /** - * @var string - */ private string $identityId; public function setIdentityId(string $identityId): self diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettedSecondFactorSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettedSecondFactorSearchQuery.php index 248e9a6..44de653 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettedSecondFactorSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettedSecondFactorSearchQuery.php @@ -25,9 +25,6 @@ class VettedSecondFactorSearchQuery implements HttpQuery { - /** - * @var string - */ private string $identityId; public function setIdentityId(string $identityId): self diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettingTypeHint.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettingTypeHint.php index 39892d6..b59a064 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettingTypeHint.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/VettingTypeHint.php @@ -22,23 +22,15 @@ final class VettingTypeHint { - /** - * @var string - */ public string $institution; /** * Keyed on locale, the hints shown to the * Self Service user to determine what vetting * type it should use. - * - * @var array */ public array $hints; - /** - * @var string - */ public string $identityId; public static function from(array $apiResult): self diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Service/IdentityService.php b/src/Surfnet/StepupMiddlewareClient/Identity/Service/IdentityService.php index 7026503..3afc378 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Service/IdentityService.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Service/IdentityService.php @@ -36,8 +36,6 @@ public function __construct(private readonly ApiService $apiService) } /** - * @param string $id - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. @@ -52,10 +50,6 @@ public function search(IdentitySearchQuery $searchQuery): ?array return $this->apiService->read('identity', [], $searchQuery); } - /** - * @param string $identityId - * @return array|null - */ public function getRegistrationAuthorityCredentials(string $identityId): ?array { return $this->apiService->read('registration-authority/%s', [$identityId]); diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Service/RaService.php b/src/Surfnet/StepupMiddlewareClient/Identity/Service/RaService.php index d0d50c7..e9a838c 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Service/RaService.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Service/RaService.php @@ -28,10 +28,6 @@ public function __construct(private readonly ApiService $apiService) { } - /** - * @param string $institution - * @return array|null - */ public function listRas(string $institution): ?array { return $this->apiService->read('registration-authority?institution=%s', [$institution]); diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Service/SecondFactorService.php b/src/Surfnet/StepupMiddlewareClient/Identity/Service/SecondFactorService.php index 56f2645..50ef257 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Service/SecondFactorService.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Service/SecondFactorService.php @@ -39,8 +39,6 @@ public function __construct(private readonly ApiService $apiService) } /** - * @param string $secondFactorId - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. @@ -51,8 +49,6 @@ public function getUnverified(string $secondFactorId): ?array } /** - * @param string $secondFactorId - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. @@ -64,8 +60,6 @@ public function getVerified(string $secondFactorId): ?array /** - * @param string $secondFactorId - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. @@ -76,8 +70,6 @@ public function getVerifiedCanSkipProvePossession(string $secondFactorId): ?arra } /** - * @param string $secondFactorId - * @return null|array * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws ResourceReadException When the server doesn't respond with the resource. * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. diff --git a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php index 63d118f..4cc8c05 100644 --- a/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php +++ b/src/Surfnet/StepupMiddlewareClient/Service/ApiService.php @@ -90,11 +90,6 @@ public function read(string $path, array $parameters = [], ?HttpQuery $httpQuery return $data; } - /** - * @param string $path - * @param HttpQuery|null $httpQuery - * @return string - */ private function buildResourcePath(string $path, array $parameters, ?HttpQuery $httpQuery = null): string { $resource = $parameters !== [] ? vsprintf($path, array_map(urlencode(...), $parameters)) : $path; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Command/Command.php b/src/Surfnet/StepupMiddlewareClientBundle/Command/Command.php index 4bb452c..5ac4dd0 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Command/Command.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Command/Command.php @@ -24,19 +24,12 @@ interface Command { - /** - * @return string|null - */ public function getUuid(): ?string; /** - * @param string $uuid * @throws DomainException Thrown when UUID is already set. */ public function setUuid(string $uuid); - /** - * @return array - */ public function serialise(): array; } diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Command/Metadata.php b/src/Surfnet/StepupMiddlewareClientBundle/Command/Metadata.php index aedd084..a1480c9 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Command/Metadata.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Command/Metadata.php @@ -34,9 +34,6 @@ public function __construct(?string $actorId, ?string $actorInstitution) $this->actorInstitution = $actorInstitution; } - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php index 872ca7e..e85f7bf 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php @@ -25,42 +25,22 @@ class AddRaLocationCommand extends AbstractCommand { - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $id; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $name; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $location; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $contactInformation; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php index 408fdf0..77f8fcd 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php @@ -25,42 +25,22 @@ class ChangeRaLocationCommand extends AbstractCommand { - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $id; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $name; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $location; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $contactInformation; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/RemoveRaLocationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/RemoveRaLocationCommand.php index 5ee946f..f12b71a 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/RemoveRaLocationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/RemoveRaLocationCommand.php @@ -24,19 +24,10 @@ class RemoveRaLocationCommand extends AbstractCommand { - /** - * @var string - */ public string $institution; - /** - * @var string - */ public string $raLocationId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php index 99e8969..f8ca44e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/InstitutionConfigurationOptions.php @@ -58,10 +58,6 @@ class InstitutionConfigurationOptions implements Dto public $selectRaa; - /** - * @param array $data - * @return InstitutionConfigurationOptions - */ public static function fromData(array $data): self { $institutionConfigurationOptions = new self(); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php index aa3aac3..3d8cee9 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php @@ -25,41 +25,22 @@ class RaLocation implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.id.must_be_string')] public string $id; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.institution.must_be_string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.name.must_be_string')] public string $name; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_location.location.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.location.must_be_string')] public string $location; - /** - * @var string - */ #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_location.contact_information.must_be_string')] public string $contactInformation; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php index 8422b70..342e85a 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php @@ -34,9 +34,6 @@ public function __construct( ) { } - /** - * @return null|InstitutionConfigurationOptions - */ public function getInstitutionConfigurationOptionsFor(string $institution): ?InstitutionConfigurationOptions { $data = $this->service->getInstitutionConfigurationOptionsFor($institution); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php index 119b534..302112b 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/RaLocationService.php @@ -36,10 +36,6 @@ public function __construct(private readonly LibraryRaLocationService $service, { } - /** - * @param string $id - * @return null|RaLocation - */ public function get(string $id): ?RaLocation { $data = $this->service->get($id); @@ -55,9 +51,6 @@ public function get(string $id): ?RaLocation return $raLocation; } - /** - * @return RaLocationCollection - */ public function search(RaLocationSearchQuery $searchQuery): RaLocationCollection { $data = $this->service->search($searchQuery); @@ -80,7 +73,6 @@ public function search(RaLocationSearchQuery $searchQuery): RaLocationCollection /** * @param object $value - * @param string|null $message */ private function assertIsValid(mixed $value, ?string $message = null): void { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Dto/CollectionDto.php b/src/Surfnet/StepupMiddlewareClientBundle/Dto/CollectionDto.php index 27ab919..7ee9916 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Dto/CollectionDto.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Dto/CollectionDto.php @@ -65,9 +65,6 @@ public static function empty(): static /** * Load the element in the collection based on the data given - * - * @param array $item - * @return mixed */ protected static function createElementFromData(array $item): mixed { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidArgumentException.php b/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidArgumentException.php index 72c75eb..b5df46d 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidArgumentException.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidArgumentException.php @@ -26,7 +26,6 @@ class InvalidArgumentException extends \InvalidArgumentException * @param string $expected description of expected type * @param $parameterName * @param mixed $parameter the parameter that is not of the expected type. - * @return self */ public static function invalidType(string $expected, $parameterName, mixed $parameter): self { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidResponseException.php b/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidResponseException.php index 15d6c4e..1993460 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidResponseException.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Exception/InvalidResponseException.php @@ -25,9 +25,6 @@ class InvalidResponseException extends RuntimeException { - /** - * @param string $message - */ public static function withViolations(string $message, ConstraintViolationListInterface $violations): self { $message = sprintf('%s (%s)', $message, self::convertViolationsToString($violations)); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php index 7826bd9..cda6b9f 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php @@ -25,58 +25,31 @@ class AccreditIdentityCommand extends AbstractCommand { - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $identityId; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] #[Assert\Choice(choices: ['ra', 'raa'])] public string $role; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $location; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $contactInformation; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $raInstitution; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php index 7df7407..f003f48 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AmendRegistrationAuthorityInformationCommand.php @@ -25,41 +25,22 @@ class AmendRegistrationAuthorityInformationCommand extends AbstractCommand { - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $identityId; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $location; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $contactInformation; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $raInstitution; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AppointRoleCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AppointRoleCommand.php index 5f669a1..cb82759 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AppointRoleCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AppointRoleCommand.php @@ -24,19 +24,10 @@ class AppointRoleCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $role; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/CreateIdentityCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/CreateIdentityCommand.php index 155bd48..8f39f19 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/CreateIdentityCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/CreateIdentityCommand.php @@ -24,34 +24,16 @@ class CreateIdentityCommand extends AbstractCommand { - /** - * @var string - */ public string $id; - /** - * @var string - */ public string $nameId; - /** - * @var string - */ public string $institution; - /** - * @var string - */ public string $email; - /** - * @var string - */ public string $commonName; - /** - * @var string - */ public string $preferredLocale; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php index bddb062..12b72f9 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ExpressLocalePreferenceCommand.php @@ -25,22 +25,12 @@ class ExpressLocalePreferenceCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * - * @var string - */ #[Assert\NotBlank] #[Assert\Type(type: 'string')] public string $preferredLocale; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/PromiseSafeStoreSecretTokenPossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/PromiseSafeStoreSecretTokenPossessionCommand.php index 5a4a815..fcfd593 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/PromiseSafeStoreSecretTokenPossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/PromiseSafeStoreSecretTokenPossessionCommand.php @@ -26,22 +26,16 @@ class PromiseSafeStoreSecretTokenPossessionCommand extends AbstractCommand { /** * The ID of an existing identity. - * - * @var string */ public string $identityId; /** * The ID of the recovery code to create. - * - * @var string */ public string $recoveryTokenId; /** * The unhashed password - * - * @var string */ public string $secret; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveGssfPossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveGssfPossessionCommand.php index 0a755a6..c2e4bd3 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveGssfPossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveGssfPossessionCommand.php @@ -44,9 +44,6 @@ class ProveGssfPossessionCommand extends AbstractCommand */ public string $gssfId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhonePossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhonePossessionCommand.php index 4500183..39070a2 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhonePossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhonePossessionCommand.php @@ -26,21 +26,14 @@ class ProvePhonePossessionCommand extends AbstractCommand { /** * The ID of an existing identity. - * - * @var string */ public string $identityId; /** * The ID of the second factor to create. - * - * @var string */ public string $secondFactorId; - /** - * @var string - */ public string $phoneNumber; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhoneRecoveryTokenPossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhoneRecoveryTokenPossessionCommand.php index c62eb51..0c8b02d 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhoneRecoveryTokenPossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProvePhoneRecoveryTokenPossessionCommand.php @@ -26,21 +26,14 @@ class ProvePhoneRecoveryTokenPossessionCommand extends AbstractCommand { /** * The ID of an existing identity. - * - * @var string */ public string $identityId; /** * The ID of the Recovery Token to create. - * - * @var string */ public string $recoveryTokenId; - /** - * @var string - */ public string $phoneNumber; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveU2fDevicePossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveU2fDevicePossessionCommand.php index 30bde08..75c626a 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveU2fDevicePossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveU2fDevicePossessionCommand.php @@ -26,22 +26,16 @@ class ProveU2fDevicePossessionCommand extends AbstractCommand { /** * The ID of an existing identity. - * - * @var string */ public string $identityId; /** * The ID of the second factor to create. - * - * @var string */ public string $secondFactorId; /** * The key handle issued by the U2F device. - * - * @var string */ public string $keyHandle; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveYubikeyPossessionCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveYubikeyPossessionCommand.php index 4cca660..10ffacc 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveYubikeyPossessionCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/ProveYubikeyPossessionCommand.php @@ -26,22 +26,16 @@ class ProveYubikeyPossessionCommand extends AbstractCommand { /** * The ID of an existing identity. - * - * @var string */ public string $identityId; /** * The ID of the second factor to create. - * - * @var string */ public string $secondFactorId; /** * The Yubikey's public ID. - * - * @var string */ public string $yubikeyPublicId; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php index 851d253..882d4fb 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RegisterSelfAssertedSecondFactorCommand.php @@ -24,39 +24,18 @@ class RegisterSelfAssertedSecondFactorCommand extends AbstractCommand { - /** - * @var string - */ public string $authorityId; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; - /** - * @var string - */ public string $registrationCode; - /** - * @var string - */ public string $secondFactorType; - /** - * @var string - */ public string $secondFactorIdentifier; - /** - * @var string - */ public string $authoringRecoveryTokenId; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RetractRegistrationAuthorityCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RetractRegistrationAuthorityCommand.php index 579ffd2..bf1d8e2 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RetractRegistrationAuthorityCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RetractRegistrationAuthorityCommand.php @@ -24,14 +24,8 @@ class RetractRegistrationAuthorityCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $institution; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnRecoveryTokenCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnRecoveryTokenCommand.php index c76125e..23efbe7 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnRecoveryTokenCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnRecoveryTokenCommand.php @@ -24,19 +24,10 @@ class RevokeOwnRecoveryTokenCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $recoveryTokenId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnSecondFactorCommand.php index 32c16c9..d85755f 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeOwnSecondFactorCommand.php @@ -24,19 +24,10 @@ class RevokeOwnSecondFactorCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsRecoveryTokenCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsRecoveryTokenCommand.php index dddfba2..4fad1d7 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsRecoveryTokenCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsRecoveryTokenCommand.php @@ -24,24 +24,12 @@ class RevokeRegistrantsRecoveryTokenCommand extends AbstractCommand { - /** - * @var string - */ public string $authorityId; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $recoveryTokenId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsSecondFactorCommand.php index d80924f..d3e8fd6 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/RevokeRegistrantsSecondFactorCommand.php @@ -24,24 +24,12 @@ class RevokeRegistrantsSecondFactorCommand extends AbstractCommand { - /** - * @var string - */ public string $authorityId; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; - /** - * @return array - */ public function serialise(): array { return [ diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php index ecbc1f8..85ddbb6 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SaveVettingTypeHintCommand.php @@ -24,14 +24,8 @@ class SaveVettingTypeHintCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $institution; /** diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php index 721450e..f208846 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SelfVetSecondFactorCommand.php @@ -24,39 +24,18 @@ class SelfVetSecondFactorCommand extends AbstractCommand { - /** - * @var string - */ public string $authorityId; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; - /** - * @var string - */ public string $registrationCode; - /** - * @var string - */ public string $secondFactorType; - /** - * @var string - */ public string $secondFactorIdentifier; - /** - * @var string - */ public string $authoringSecondFactorIdentifier; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SendSecondFactorRegistrationEmailCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SendSecondFactorRegistrationEmailCommand.php index 355f891..5d83f09 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SendSecondFactorRegistrationEmailCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/SendSecondFactorRegistrationEmailCommand.php @@ -24,14 +24,8 @@ class SendSecondFactorRegistrationEmailCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/UpdateIdentityCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/UpdateIdentityCommand.php index e03d5b5..59f5959 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/UpdateIdentityCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/UpdateIdentityCommand.php @@ -24,20 +24,10 @@ class UpdateIdentityCommand extends AbstractCommand { - /** - * @var string - */ public string $email; - /** - * @var string - */ public string $commonName; - /** - * @param string $id - * @param string $institution - */ public function __construct(public string $id, public string $institution) { } diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VerifyEmailCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VerifyEmailCommand.php index 19c626d..67409cb 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VerifyEmailCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VerifyEmailCommand.php @@ -24,14 +24,8 @@ class VerifyEmailCommand extends AbstractCommand { - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $verificationNonce; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VetSecondFactorCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VetSecondFactorCommand.php index 28468b1..b54c59f 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VetSecondFactorCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/VetSecondFactorCommand.php @@ -24,49 +24,22 @@ class VetSecondFactorCommand extends AbstractCommand { - /** - * @var string - */ public string $authorityId; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $secondFactorId; - /** - * @var string - */ public string $registrationCode; - /** - * @var string - */ public string $secondFactorType; - /** - * @var string - */ public string $secondFactorIdentifier; - /** - * @var string - */ public string $documentNumber; - /** - * @var bool - */ public bool $provePossessionSkipped; - /** - * @var boolean - */ public bool $identityVerified; public function serialise(): array diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/AuditLogEntry.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/AuditLogEntry.php index 4659273..6b1c8c4 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/AuditLogEntry.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/AuditLogEntry.php @@ -25,69 +25,30 @@ final class AuditLogEntry implements Dto { - /** - * @var string|null - */ public ?string $actorId; - /** - * @var string|null - */ public ?string $actorInstitution; - /** - * @var string|null - */ public ?string $raInstitution; - /** - * @var string - */ public string $actorCommonName; - /** - * @var string - */ public string $identityId; - /** - * @var string - */ public string $identityInstitution; - /** - * @var string|null - */ public ?string $secondFactorId; - /** - * @var string|null - */ public ?string $secondFactorType; - /** - * @var string - */ public ?string $secondFactorIdentifier; - /** - * @var string - */ public ?string $recoveryTokenIdentifier; - /** - * @var string - */ public ?string $recoveryTokenType; - /** - * @var string - */ public string $action; - /** - * @var DateTime - */ public DateTime $recordedOn; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php index 873a735..76ed8be 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php @@ -32,37 +32,22 @@ class Identity implements Dto, Serializable, Stringable #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.id.must_be_string')] public ?string $id = null; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.name_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.name_id.must_be_string')] public string $nameId; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.institution.must_be_string')] public string $institution; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.email.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.email.must_be_string')] public string $email; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.common_name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.common_name.must_be_string')] public string $commonName; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.preferred_locale.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.preferred_locale.must_be_string')] public string $preferredLocale; @@ -110,8 +95,6 @@ public function unserialize(string $data): void /** * This is a requirement to be able to set the identity as user in the TokenInterface. * (so we can use it as user in SF) - * - * @return string */ public function __toString(): string { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php index 8359180..59dbf61 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php @@ -25,10 +25,6 @@ class InstitutionListing implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.institution_listing.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.institution_listing.institution.must_be_string')] public string $institution; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php index 73f5054..7c10cf1 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Profile.php @@ -25,56 +25,32 @@ class Profile implements Dto { - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.id.must_be_string')] public string $id; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.name_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.name_id.must_be_string')] public string $nameId; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.institution.must_be_string')] public string $institution; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.email.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.email.must_be_string')] public string $email; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.common_name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.common_name.must_be_string')] public string $commonName; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.identity.preferred_locale.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.identity.preferred_locale.must_be_string')] public string $preferredLocale; - /** - * @var bool - */ public bool $isSraa; - /** - * @var array - */ public array $authorizations; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php index 1ffee50..548ab4b 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php @@ -25,42 +25,22 @@ class RaCandidate implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.identity_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.identity_id.must_be_string')] public string $identityId; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.institution.must_be_string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.name_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.name_id.must_be_string')] public string $nameId; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.common_name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.common_name.must_be_string')] public string $commonName; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate.email.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate.email.must_be_string')] public string $email; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php index 4735a77..26fd6d1 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php @@ -25,10 +25,6 @@ class RaCandidateInstitution implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_candidate_institution.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_candidate_institution.institution.must_be_string')] public string $institution; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitutions.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitutions.php index fe86172..60c4e74 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitutions.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitutions.php @@ -24,14 +24,8 @@ class RaCandidateInstitutions implements Dto { - /** - * @var RaCandidate - */ public RaCandidate $raCandidate; - /** - * @var RaCandidateInstitutionCollection - */ public RaCandidateInstitutionCollection $institutions; public static function fromData(array $data): self diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php index 56ebb8e..b203c5b 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php @@ -25,66 +25,34 @@ class RaListing implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.id.must_be_string')] public string $identityId; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.institution.must_be_string')] public string $institution; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.institution.must_be_string')] public string $raInstitution; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.common_name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.common_name.must_be_string')] public string $commonName; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.email.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.email.must_be_string')] public string $email; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.role.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.role.must_be_string')] public string $role; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.location.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.location.must_be_string')] public string $location; - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_listing.contact_information.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_listing.contact_information.must_be_string')] public string $contactInformation; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListingCollection.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListingCollection.php index 4d3099d..f5ab77b 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListingCollection.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListingCollection.php @@ -48,7 +48,6 @@ protected static function createElementFromData(array $raListing): RaListing /** * Checks if a certain institution is listed in the RA listing * @param $institution - * @return bool */ public function isListed($institution): bool { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php index 0b66181..b430334 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php @@ -24,9 +24,6 @@ class RaSecondFactorExportCollection { - /** - * @var array - */ #[Assert\Valid] protected array $elements; @@ -61,9 +58,6 @@ public function getColumnNames(): array ]; } - /** - * @return array - */ public function getElements(): array { return $this->elements; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php index b7757b4..61bfa65 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php @@ -25,47 +25,25 @@ class RegistrationAuthorityCredentials implements Dto { - /** - * - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.ra_credentials.identity_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.ra_credentials.identity_id.must_be_string')] public string $identityId; - /** - * @var string - */ #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.institution.must_be_null_or_string')] public string $institution; - /** - * @var string - */ #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.common_name.must_be_null_or_string')] public string $commonName; - /** - * @var string - */ #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.location.must_be_null_or_string')] public string $location; - /** - * @var string - */ #[Assert\Expression('this.assertNullOrString(value)', message: 'middleware_client.dto.ra_credentials.contact_information.must_be_null_or_string')] public string $contactInformation; - /** - * @var bool - */ #[Assert\Type(type: 'bool', message: 'middleware_client.dto.ra_credentials.is_raa.must_be_boolean')] public bool $isRaa; - /** - * @var bool - */ #[Assert\Type(type: 'bool', message: 'middleware_client.dto.ra_credentials.is_sraa.must_be_boolean')] public bool $isSraa; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php index 93681e1..c1bbaa5 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php @@ -25,23 +25,14 @@ class UnverifiedSecondFactor implements Dto { - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.id.must_be_string')] public string $id; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.type.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.type.must_be_string')] public string $type; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.unverified_second_factor.second_factor_identifier.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.unverified_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php index 8a496fa..038a79b 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php @@ -26,57 +26,33 @@ class VerifiedSecondFactor implements Dto { - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.id.must_be_string')] public string $id; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.type.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.type.must_be_string')] public string $type; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.second_factor_identifier.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.registration_code.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.registration_code.must_be_string')] public string $registrationCode; - /** - * @var DateTime - */ public DateTime $registrationRequestedAt; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.identity_id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.identity_id.must_be_string')] public string $identityId; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.institution.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.institution.must_be_string')] public string $institution; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.verified_second_factor.common_name.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.verified_second_factor.common_name.must_be_string')] public string $commonName; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php index ca77483..e1ee55c 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php @@ -25,37 +25,24 @@ class VettedSecondFactor implements Dto { - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.id.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.id.must_be_string')] public string $id; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.type.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.type.must_be_string')] public string $type; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.second_factor_identifier.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.second_factor_identifier.must_be_string')] public string $secondFactorIdentifier; - /** - * @var string - */ #[Assert\NotBlank(message: 'middleware_client.dto.vetted_second_factor.vetting_typ.must_not_be_blank')] #[Assert\Type(type: 'string', message: 'middleware_client.dto.vetted_second_factor.veting_type.must_be_string')] public string $vettingType; /** * The calculated loa level based on vetting type and seconnd factor type - * @var float */ public float $loaLevel; diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/InstitutionListingService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/InstitutionListingService.php index 5758ec1..2b976f1 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/InstitutionListingService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/InstitutionListingService.php @@ -31,9 +31,6 @@ public function __construct(private readonly LibraryInstitutionListingService $c { } - /** - * @return InstitutionListingCollection - */ public function getAll(): InstitutionListingCollection { $data = $this->clientService->getAll(); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php index 5f1481e..751b41a 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/ProfileService.php @@ -31,10 +31,6 @@ class ProfileService public function __construct(private readonly LibraryProfileService $service, private readonly ValidatorInterface $validator) { } - /** - * @param string $identityId - * @return null|Profile - */ public function get(string $identityId): ?Profile { $query = new ProfileSearchQuery($identityId, $identityId); @@ -54,7 +50,6 @@ public function get(string $identityId): ?Profile /** * @param object $value - * @param string|null $message */ private function assertIsValid(mixed $value, ?string $message = null): void { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaCandidateService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaCandidateService.php index 216d999..48eb812 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaCandidateService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaCandidateService.php @@ -33,9 +33,6 @@ public function __construct(private readonly LibraryRaCandidateService $libraryS { } - /** - * @return RaCandidateCollection - */ public function search(RaCandidateSearchQuery $query): RaCandidateCollection { $data = $this->libraryService->search($query); diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php index 5b075b2..fa5f8bc 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaListingService.php @@ -51,9 +51,6 @@ public function get(string $id, string $institution, string $actorId): ?RaListin return $raListing; } - /** - * @return RaListingCollection - */ public function search(RaListingSearchQuery $searchQuery): RaListingCollection { $data = $this->service->search($searchQuery); @@ -76,7 +73,6 @@ public function search(RaListingSearchQuery $searchQuery): RaListingCollection /** * @param object $value - * @param string|null $message */ private function assertIsValid(mixed $value, ?string $message = null): void { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php index a6e9804..7fbda3e 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php @@ -34,10 +34,6 @@ public function __construct(private readonly LibraryRaService $service, private { } - /** - * @param string $institution - * @return RegistrationAuthorityCredentialsCollection - */ public function listRas(string $institution): RegistrationAuthorityCredentialsCollection { $data = $this->service->listRas($institution); @@ -55,7 +51,6 @@ public function listRas(string $institution): RegistrationAuthorityCredentialsCo /** * @param object $value - * @param string|null $message */ private function assertIsValid(mixed $value, ?string $message = null): void { diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php index 33c69a7..3c5ebb7 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php @@ -53,8 +53,6 @@ public function __construct( } /** - * @param string $secondFactorId - * @return UnverifiedSecondFactor|null * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws InvalidResponseException When the API responded with invalid data. * @throws ResourceReadException When the API doesn't respond with the resource. @@ -82,8 +80,6 @@ public function getUnverified(string $secondFactorId): ?UnverifiedSecondFactor } /** - * @param string $secondFactorId - * @return VerifiedSecondFactor|null * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws InvalidResponseException When the API responded with invalid data. * @throws ResourceReadException When the API doesn't respond with the resource. @@ -122,8 +118,6 @@ public function getVerifiedCanSkipProvePossession(string $secondFactorId): bool } /** - * @param string $secondFactorId - * @return VettedSecondFactor|null * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. * @throws InvalidResponseException When the API responded with invalid data. * @throws ResourceReadException When the API doesn't respond with the resource. diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php index 7b6cb87..3c7bf92 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Configuration/Service/InstitutionConfigurationOptionsServiceTest.php @@ -87,10 +87,6 @@ public function testQueriedInstitutionConfigurationOptionsAreConvertedToADtoCorr $this->assertEquals($expectedInstitutionConfigurationOptions, $actualInstitutionConfigurationOptions); } - /** - * - * @param array|string|int|float|stdClass|null $nonBoolean - */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] #[\PHPUnit\Framework\Attributes\DataProvider('nonBooleanProvider')] public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocationsOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void @@ -138,10 +134,6 @@ public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocations $service->getInstitutionConfigurationOptionsFor($institution); } - /** - * - * @param array|string|int|float|stdClass|null $nonBoolean - */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] #[\PHPUnit\Framework\Attributes\DataProvider('nonBooleanProvider')] public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContactInformationOptionAreInvalid(null|array|string|int|float|stdClass $nonBoolean): void @@ -189,10 +181,6 @@ public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContact $service->getInstitutionConfigurationOptionsFor($institution); } - /** - * - * @param bool|string|int|float|stdClass|null $nonArray - */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] #[\PHPUnit\Framework\Attributes\DataProvider('nonArrayProvider')] public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFactorsAreInvalid(null|bool|string|int|float|stdClass $nonArray): void @@ -240,10 +228,6 @@ public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFac $service->getInstitutionConfigurationOptionsFor($institution); } - /** - * - * @param bool|array|int|float|stdClass|null $nonArray - */ #[\PHPUnit\Framework\Attributes\Group('institution-configuration')] #[\PHPUnit\Framework\Attributes\DataProvider('nonStringProvider')] public function testInstitutionConfigurationOptionsWithANonStringsAllowedSecondFactorsAreInvalid(null|bool|array|int|float|stdClass $nonArray): void diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php index 353529d..00937a0 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php @@ -38,13 +38,6 @@ protected function tearDown(): void m::close(); } - /** - * @param string $expectedCommandName - * @param array $expectedPayload - * @param array $expectedMetadataPayload - * @param Command $command - * @param Metadata $metadata - */ #[\PHPUnit\Framework\Attributes\DataProvider('commands')] public function testItExecutesCommands( string $expectedCommandName, diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/CauseCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/CauseCommand.php index 8451b57..53a2233 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/CauseCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/CauseCommand.php @@ -24,9 +24,6 @@ class CauseCommand extends AbstractCommand { - /** - * @var array - */ public array $payload; public function __construct(array $payload) diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/Name/Spaced/ZigCommand.php b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/Name/Spaced/ZigCommand.php index 163cb71..40462b5 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/Name/Spaced/ZigCommand.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/Fixtures/Root/Command/Name/Spaced/ZigCommand.php @@ -24,9 +24,6 @@ class ZigCommand extends AbstractCommand { - /** - * @var array - */ public array $payload; public function __construct(array $payload) diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Uuid/Uuid.php b/src/Surfnet/StepupMiddlewareClientBundle/Uuid/Uuid.php index b55d281..3172e79 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/Uuid/Uuid.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/Uuid/Uuid.php @@ -24,9 +24,6 @@ class Uuid { - /** - * @return string - */ public static function generate(): string { return (string) RamseyUuid::uuid4();