From 090634ba518f50b54e255d7552150c0ca3721507 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 15:06:21 +0200 Subject: [PATCH] Suppress UnnecessaryVarAnnotation for needed @var Symfony 5 does not properly annotate yet --- src/Configuration/Loader/AbstractFileLoader.php | 4 ++++ src/Configuration/Loader/YamlLoader.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Configuration/Loader/AbstractFileLoader.php b/src/Configuration/Loader/AbstractFileLoader.php index dfbef40..eb9d029 100644 --- a/src/Configuration/Loader/AbstractFileLoader.php +++ b/src/Configuration/Loader/AbstractFileLoader.php @@ -204,6 +204,10 @@ protected function glob( return; } + /** + * @psalm-suppress UnnecessaryVarAnnotation - Needed for symfony 5 annotations. + * @var string $prefix + */ $resource = new GlobResource($prefix, $pattern, $recursive, $forExclusion, $excluded); foreach ($resource->getIterator() as $filename => $fileInfo) { diff --git a/src/Configuration/Loader/YamlLoader.php b/src/Configuration/Loader/YamlLoader.php index 7089cd9..3c2c527 100644 --- a/src/Configuration/Loader/YamlLoader.php +++ b/src/Configuration/Loader/YamlLoader.php @@ -46,6 +46,10 @@ public function load($resource, $type = null): void if (!is_string($resource)) { throw new InvalidArgumentException('Resource is not a string'); } + /** + * @psalm-suppress UnnecessaryVarAnnotation - Needed for symfony 5 annotations. + * @var string $path + */ $path = $this->locator->locate($resource); $content = $this->loadFile($path);