From 8c3b82d4bb3c8df13431f4fafb0b26429d85b827 Mon Sep 17 00:00:00 2001 From: Mati Kochen Date: Fri, 22 Dec 2023 11:48:33 +0100 Subject: [PATCH] feat: bump to psalm 5 --- DependencyInjection/Configuration.php | 5 +++++ Security/Exception/LtiToolMessageExceptionHandler.php | 1 + composer.json | 5 +++-- psalm.xml.dist | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index af0249c..e0f567d 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -47,6 +47,7 @@ public function getConfigTreeBuilder(): TreeBuilder public function addScopesConfiguration(ArrayNodeDefinition $rootNode): self { + /** @psalm-suppress UndefinedInterfaceMethod */ $rootNode ->fixXmlConfig('scope') ->children() @@ -61,6 +62,7 @@ public function addScopesConfiguration(ArrayNodeDefinition $rootNode): self public function addKeyChainsConfiguration(ArrayNodeDefinition $rootNode): self { + /** @psalm-suppress UndefinedInterfaceMethod */ $rootNode ->fixXmlConfig('key_chain') ->children() @@ -83,6 +85,7 @@ public function addKeyChainsConfiguration(ArrayNodeDefinition $rootNode): self public function addPlatformsConfiguration(ArrayNodeDefinition $rootNode): self { + /** @psalm-suppress UndefinedInterfaceMethod */ $rootNode ->fixXmlConfig('platform') ->children() @@ -104,6 +107,7 @@ public function addPlatformsConfiguration(ArrayNodeDefinition $rootNode): self public function addToolsConfiguration(ArrayNodeDefinition $rootNode): self { + /** @psalm-suppress UndefinedInterfaceMethod */ $rootNode ->fixXmlConfig('tool') ->children() @@ -126,6 +130,7 @@ public function addToolsConfiguration(ArrayNodeDefinition $rootNode): self public function addRegistrationsConfiguration(ArrayNodeDefinition $rootNode): self { + /** @psalm-suppress UndefinedInterfaceMethod */ $rootNode ->fixXmlConfig('registration') ->children() diff --git a/Security/Exception/LtiToolMessageExceptionHandler.php b/Security/Exception/LtiToolMessageExceptionHandler.php index a9645ab..6c81d37 100644 --- a/Security/Exception/LtiToolMessageExceptionHandler.php +++ b/Security/Exception/LtiToolMessageExceptionHandler.php @@ -52,6 +52,7 @@ public function handle(Throwable $exception, Request $request): Response $message = urlencode($exception->getMessage()); if (null !== $launchPresentation && null !== $launchPresentation->getReturnUrl()) { + /** @psalm-suppress PossiblyNullArgument - getReturnUrl cannot be null here */ $redirectUrl = sprintf( '%s%slti_msg=%s<i_log=%s<i_errormsg=%s<i_errorlog=%s', $launchPresentation->getReturnUrl(), diff --git a/composer.json b/composer.json index 7583d89..d8af378 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "nyholm/psr7": "^1.8", "oat-sa/lib-lti1p3-core": "^7.0", "psr/log": "^1 || ^2 || ^3", + "symfony/console": "^5.4", "symfony/framework-bundle": "^5.4", "symfony/psr-http-message-bridge": "^2.0", "symfony/security-bundle": "^5.4", @@ -24,9 +25,9 @@ "nesbot/carbon": "^2.72", "php-coveralls/php-coveralls": "^2.4", "phpunit/phpunit": "~9", - "psalm/plugin-phpunit": "^0.15.1", + "psalm/plugin-phpunit": "^0.18.4", "symfony/browser-kit": "^5.4", - "vimeo/psalm": "^4.6" + "vimeo/psalm": "^5.18" }, "autoload": { "psr-4": { diff --git a/psalm.xml.dist b/psalm.xml.dist index cc2ddcf..8fbf38c 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -7,6 +7,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + findUnusedBaselineEntry="true" + findUnusedCode="false" >