From d3583d3f309dc68c984d22ff4edd8e436776b475 Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Wed, 2 Aug 2023 17:40:58 +0300 Subject: Fix psalm ci (stub). Wrap server container with try-catch Signed-off-by: Andrey Borysenko --- build/stubs/app_ecosystem_v2.php | 15 +++++++++++++++ lib/base.php | 8 ++++++-- psalm.xml | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 build/stubs/app_ecosystem_v2.php diff --git a/build/stubs/app_ecosystem_v2.php b/build/stubs/app_ecosystem_v2.php new file mode 100644 index 00000000000..d2b07c9c616 --- /dev/null +++ b/build/stubs/app_ecosystem_v2.php @@ -0,0 +1,15 @@ +isInstalled('app_ecosystem_v2')) { return false; } - $appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class); - return $appEcosystemV2Service->validateExAppRequestToNC($request); + try { + $appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class); + return $appEcosystemV2Service->validateExAppRequestToNC($request); + } catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) { + return false; + } } } diff --git a/psalm.xml b/psalm.xml index 87cecf3e2d2..cb7409489a8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -81,6 +81,7 @@ + -- cgit v1.2.3