diff --git a/CHANGELOG.md b/CHANGELOG.md index c9dc35a..7309ff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +## [3.21.2] 2025-01-07 + +- Adds missing `http-message-util` requirement and use statement. +- Runs code-analysis on `os2forms_fbs_handler` module. + ## [3.21.1] 2025-01-06 - Updated Maestro notification handler assignment message format. @@ -328,7 +333,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa - Security in case of vulnerabilities. ``` -[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.21.1...HEAD +[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.21.2...HEAD +[3.21.2]: https://github.com/OS2Forms/os2forms/compare/3.21.1...3.21.2 [3.21.1]: https://github.com/OS2Forms/os2forms/compare/3.21.0...3.21.1 [3.21.0]: https://github.com/OS2Forms/os2forms/compare/3.20.1...3.21.0 [3.20.1]: https://github.com/OS2Forms/os2forms/compare/3.20.0...3.20.1 diff --git a/composer.json b/composer.json index 401909b..fdbcb4f 100644 --- a/composer.json +++ b/composer.json @@ -65,6 +65,7 @@ "drupal/webform_validation": "^2.0", "drupal/webform_views": "^5.0@alpha", "drupal/workflow_participants": "^3.0@RC", + "fig/http-message-util": "^1.1", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", "itk-dev/serviceplatformen": "^1.5", diff --git a/modules/os2forms_fbs_handler/src/Client/FBS.php b/modules/os2forms_fbs_handler/src/Client/FBS.php index 44b8f6a..66c38b4 100644 --- a/modules/os2forms_fbs_handler/src/Client/FBS.php +++ b/modules/os2forms_fbs_handler/src/Client/FBS.php @@ -4,6 +4,7 @@ use Drupal\os2forms_fbs_handler\Client\Model\Guardian; use Drupal\os2forms_fbs_handler\Client\Model\Patron; +use Fig\Http\Message\RequestMethodInterface; use GuzzleHttp\Client; use Symfony\Component\HttpFoundation\Request; @@ -242,6 +243,8 @@ public function createGuardian(Patron $patron, Guardian $guardian): int { * * @throws \GuzzleHttp\Exception\GuzzleException * @throws \JsonException + * + * @phpstan-param array|string $data */ private function request(string $uri, array|string $data, string $method = Request::METHOD_POST): mixed { $url = rtrim($this->endpoint, '/\\'); diff --git a/modules/os2forms_fbs_handler/src/Client/Model/Guardian.php b/modules/os2forms_fbs_handler/src/Client/Model/Guardian.php index 371d3bb..b72a648 100644 --- a/modules/os2forms_fbs_handler/src/Client/Model/Guardian.php +++ b/modules/os2forms_fbs_handler/src/Client/Model/Guardian.php @@ -22,6 +22,8 @@ public function __construct( * * @return array * Array with field required by FBS calls. + * + * @phpstan-return array */ public function toArray(): array { return [ diff --git a/modules/os2forms_fbs_handler/src/Client/Model/Patron.php b/modules/os2forms_fbs_handler/src/Client/Model/Patron.php index e5e7d56..db3e1d0 100644 --- a/modules/os2forms_fbs_handler/src/Client/Model/Patron.php +++ b/modules/os2forms_fbs_handler/src/Client/Model/Patron.php @@ -9,6 +9,10 @@ final class Patron { /** * Default constructor. + * + * @phpstan-param array|null $notificationProtocols + * @phpstan-param array|null $onHold + * @phpstan-param array|null $emailAddresses */ public function __construct( public readonly ?string $patronId = NULL, @@ -35,6 +39,8 @@ public function __construct( * * @return array * Array with field required by FBS calls. + * + * @phpstan-return array */ public function toArray(): array { return [ diff --git a/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php b/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php index 179d0a1..d5de9af 100644 --- a/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php +++ b/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php @@ -35,6 +35,8 @@ final class FbsCreateUser extends JobTypeBase implements ContainerFactoryPluginI /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public function __construct( array $configuration, @@ -50,6 +52,8 @@ public function __construct( /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( diff --git a/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php b/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php index 2562514..1c2abad 100644 --- a/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php +++ b/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php @@ -45,6 +45,8 @@ final class FbsWebformHandler extends WebformHandlerBase { /** * Constructs an FbsWebformHandler object. + * + * @phpstan-param array $configuration */ public function __construct( array $configuration, @@ -70,6 +72,8 @@ public function __construct( /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( @@ -87,6 +91,10 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * + * @phpstan-param array $form + * + * @phpstan-return array */ public function buildConfigurationForm(array $form, FormStateInterface $form_state): array { if (is_null($this->getQueue())) { @@ -143,6 +151,8 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta /** * {@inheritdoc} + * + * @phpstan-param array $form */ public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void { parent::submitConfigurationForm($form, $form_state); diff --git a/phpstan.neon b/phpstan.neon index 8ece9b1..dd1fcc1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,6 +2,7 @@ parameters: level: 6 paths: - modules/os2forms_digital_post/ + - modules/os2forms_fbs_handler/ excludePaths: # @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772/ - vendor