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/.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/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
[](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/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/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/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/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 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 b3e10a1..d76918c 100644
--- a/ci/qa/phpunit.xml
+++ b/ci/qa/phpunit.xml
@@ -1,32 +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/ci/qa/rector.php b/ci/qa/rector.php
new file mode 100644
index 0000000..aee2d26
--- /dev/null
+++ b/ci/qa/rector.php
@@ -0,0 +1,22 @@
+withPaths([
+ __DIR__ . '/../../src',
+ ])
+ ->withPhpSets()
+ ->withAttributesSets(all: true)
+ ->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
+ ->withSkip([
+ ClassPropertyAssignToConstructorPromotionRector::class,
+ RestoreDefaultNullToNullableTypePropertyRector::class,
+ ])
+ ->withPHPStanConfigs([__DIR__.'/phpstan.neon'])
+ ->withPreparedSets(deadCode: true)
+ ;
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 3c8637e..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": {
@@ -10,46 +10,54 @@
}
},
"require": {
- "php": "^8.1",
- "psr/log": "~2.0",
- "surfnet/stepup-bundle": "^6.0",
- "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",
+ "php": "^8.2",
+ "beberlei/assert": "^3.3",
+ "brick/math": "^0.14.1",
"guzzlehttp/guzzle": "^7.8",
- "beberlei/assert": "~2.0",
+ "psr/log": "^3.0",
"ramsey/uuid": "^4.7",
- "brick/math": "^0.11.0"
+ "surfnet/stepup-bundle": "^7.0.1",
+ "surfnet/stepup-saml-bundle": "^7.0.1",
+ "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": {
- "matthiasnoback/symfony-config-test": "^4.0|^v5.0.0",
+ "malukenho/docheader": "^1.1",
+ "matthiasnoback/symfony-config-test": "^6.1",
"mockery/mockery": "^1.6",
- "overtrue/phplint": "*",
+ "overtrue/phplint": "^9.7.1",
"phpmd/phpmd": "^2.13",
- "phpstan/phpstan": "^1.10",
- "phpstan/phpstan-symfony": "^1.3",
- "phpunit/phpunit": "^9.6",
- "sebastian/phpcpd": "^6.0",
- "slevomat/coding-standard": "^8.13",
- "squizlabs/php_codesniffer": "^3.7.1",
- "symfony/phpunit-bridge": "^5.4|^6.3"
+ "phpstan/phpstan": "^2",
+ "phpstan/phpstan-symfony": "^2",
+ "phpunit/phpunit": "^11.5.46",
+ "rector/rector": "^2",
+ "slevomat/coding-standard": "^8.26",
+ "squizlabs/php_codesniffer": "^4.0",
+ "symfony/phpunit-bridge": "^6.4|^7.4"
},
"scripts": {
"check": [
+ "@check-ci",
+ "@rector"
+ ],
+ "check-ci": [
"@composer-validate",
+ "@license-headers",
"@phplint",
- "@phpcpd",
"@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",
- "phpcpd": "./ci/qa/phpcpd",
"phpmd": "./ci/qa/phpmd",
"phpstan": "./ci/qa/phpstan",
"phpstan-baseline": "./ci/qa/phpstan-update-baseline",
@@ -61,5 +69,6 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
- }
+ },
+ "type": "library"
}
diff --git a/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php
index 348f590..072b435 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;
@@ -22,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 fc7b943..b4fc9e6 100644
--- a/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php
+++ b/src/Surfnet/StepupMiddlewareClient/Exception/AccessDeniedToResourceException.php
@@ -25,12 +25,10 @@
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)
+ 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/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 891c039..ac35f0c 100644
--- a/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php
+++ b/src/Surfnet/StepupMiddlewareClient/Exception/ResourceReadException.php
@@ -27,9 +27,8 @@ 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)
+ 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/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 4cec301..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
@@ -117,8 +114,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/Identity/Dto/SecondFactorAuditLogSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php
index 19a38ca..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 string $institution;
+ private readonly string $institution;
- /**
- * @var string
- */
- private string $identityId;
+ private readonly string $identityId;
private string $orderBy = 'recordedOn';
- /**
- * @var string|null
- */
private ?string $orderDirection = 'desc';
- /**
- * @var int
- */
- private int $pageNumber;
+ 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 35c04fe..4cc8c05 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);
@@ -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');
@@ -87,14 +90,9 @@ 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
+ 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/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/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 = [])
{
}
diff --git a/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php b/src/Surfnet/StepupMiddlewareClient/Tests/Helper/JsonHelperTest.php
index caba008..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
- * @group json
- */
+ #[\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
- * @group json
- */
+ #[\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/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/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 826a023..e85f7bf 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php
@@ -25,44 +25,24 @@
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..77f8fcd 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php
@@ -25,44 +25,24 @@
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/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 54dd34c..f8ca44e 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;
@@ -76,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 5ed73e0..3d8cee9 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Dto/RaLocation.php
@@ -25,43 +25,23 @@
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/Configuration/Service/InstitutionConfigurationOptionsService.php b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php
index 0cde885..342e85a 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Configuration/Service/InstitutionConfigurationOptionsService.php
@@ -26,17 +26,14 @@
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
) {
}
- /**
- * @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 374c0b8..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,9 +73,8 @@ 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/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 ef7f7d6..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
{
- /**
- * @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;
- /**
- * @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 08e7267..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
{
- /**
- * @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;
- /**
- * @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 3cc9fb6..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;
- /**
- * @Assert\NotBlank()
- * @Assert\Type(type="string")
- *
- * @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 729542b..882d4fb 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.
@@ -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 c165945..85ddbb6 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.
@@ -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 fd0ec9b..f208846 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.
@@ -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 ef8c33f..76ed8be 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/Identity.php
@@ -28,45 +28,28 @@
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
@@ -112,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 6f90767..59dbf61 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListing.php
@@ -25,12 +25,8 @@
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..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
{
- /**
- * @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;
- /**
- * @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 261ed22..548ab4b 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidate.php
@@ -25,44 +25,24 @@
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..26fd6d1 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitution.php
@@ -25,12 +25,8 @@
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/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 f6f13bf..b203c5b 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaListing.php
@@ -25,68 +25,36 @@
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/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 8e1b4bb..b430334 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaSecondFactorExportCollection.php
@@ -24,11 +24,7 @@
class RaSecondFactorExportCollection
{
- /**
- * @Assert\Valid
- *
- * @var array
- */
+ #[Assert\Valid]
protected array $elements;
public static function fromData(array $data): self
@@ -62,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 f2def52..61bfa65 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RegistrationAuthorityCredentials.php
@@ -25,66 +25,26 @@
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..c1bbaa5 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/UnverifiedSecondFactor.php
@@ -25,30 +25,16 @@
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..038a79b 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VerifiedSecondFactor.php
@@ -26,76 +26,35 @@
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;
- /**
- * @var DateTime
- */
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..e1ee55c 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/VettedSecondFactor.php
@@ -25,43 +25,24 @@
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;
/**
* 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 8d4cae9..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,9 +50,8 @@ 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/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 aedcf6a..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,9 +73,8 @@ 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/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/RaService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/RaService.php
index 0e6d027..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,9 +51,8 @@ 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);
diff --git a/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php b/src/Surfnet/StepupMiddlewareClientBundle/Identity/Service/SecondFactorService.php
index 70afc8a..3c5ebb7 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
{
@@ -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 c0d4974..3c7bf92 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';
@@ -89,12 +87,8 @@ public function testQueriedInstitutionConfigurationOptionsAreConvertedToADtoCorr
$this->assertEquals($expectedInstitutionConfigurationOptions, $actualInstitutionConfigurationOptions);
}
- /**
- * @group institution-configuration
- *
- * @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,12 +134,8 @@ public function testInstitutionConfigurationOptionsWithANonBooleanUseRaLocations
$service->getInstitutionConfigurationOptionsFor($institution);
}
- /**
- * @group institution-configuration
- *
- * @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,12 +181,8 @@ public function testInstitutionConfigurationOptionsWithANonBooleanShowRaaContact
$service->getInstitutionConfigurationOptionsFor($institution);
}
- /**
- * @group institution-configuration
- *
- * @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,12 +228,8 @@ public function testInstitutionConfigurationOptionsWithANonArrayAllowedSecondFac
$service->getInstitutionConfigurationOptionsFor($institution);
}
- /**
- * @group institution-configuration
- *
- * @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';
@@ -293,7 +275,7 @@ public function testInstitutionConfigurationOptionsWithANonStringsAllowedSecondF
$service->getInstitutionConfigurationOptionsFor($institution);
}
- public function nonBooleanProvider(): array
+ public static function nonBooleanProvider(): array
{
return [
'null' => [null],
@@ -305,7 +287,7 @@ public function nonBooleanProvider(): array
];
}
- public function nonArrayProvider(): array
+ public static function nonArrayProvider(): array
{
return [
'null' => [null],
@@ -317,7 +299,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..00937a0 100644
--- a/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php
+++ b/src/Surfnet/StepupMiddlewareClientBundle/Tests/Service/CommandServiceTest.php
@@ -38,14 +38,7 @@ protected function tearDown(): void
m::close();
}
- /**
- * @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 +63,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' => [
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();