From eb09e5315636524d6c5ce6f256c9f3e0570b92ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maximilian=20B=C3=B6sing?=
<2189546+boesing@users.noreply.github.com>
Date: Tue, 10 Oct 2023 21:59:10 +0200
Subject: [PATCH] qa: normalize psalm config to get rid of warnings when
running psalm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
---
psalm-baseline.xml | 43 ++++++++++++++++++++++++++++-------
psalm.xml.dist | 2 ++
src/AbstractPluginManager.php | 1 -
src/Config.php | 2 --
4 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index b6e09dce..22164e32 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -54,6 +54,12 @@
DispatchableInterface
+
+
+ canCreateServiceWithName
+ createServiceWithName
+
+
$config
@@ -77,9 +83,6 @@
is_object($configInstanceOrParentLocator)
-
- MixedAssignment
-
@@ -94,10 +97,14 @@
ServiceManagerConfigurationType
-
- MixedReturnTypeCoercion
- MixedReturnTypeCoercion
-
+
+ $allowedKeys
+
+
+
+
+ createDelegatorWithName
+
@@ -117,6 +124,16 @@
new $requestedName()
+
+
+ FactoryInterface
+
+
+
+
+ InitializerInterface
+
+
$wrappedInstance
@@ -218,6 +235,9 @@
$service
$target
+
+ DelegatorsConfiguration
+
$key
@@ -484,7 +504,6 @@
$second
$shared
- $shared
$callback()
@@ -606,6 +625,9 @@
foo]]>
option]]>
+
+ sampleFactory
+
$container
$container
@@ -615,6 +637,11 @@
$name
+
+
+ ServiceManagerConfiguration
+
+
$factoryConfig[ObjectWithObjectScalarDependency::class]
diff --git a/psalm.xml.dist b/psalm.xml.dist
index d71e2eec..6760f4c2 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -6,6 +6,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedPsalmSuppress="true"
+ findUnusedCode="true"
+ findUnusedBaselineEntry="true"
>
diff --git a/src/AbstractPluginManager.php b/src/AbstractPluginManager.php
index 1e113e12..0a652e5e 100644
--- a/src/AbstractPluginManager.php
+++ b/src/AbstractPluginManager.php
@@ -117,7 +117,6 @@ public function __construct($configInstanceOrParentLocator = null, array $config
public function configure(array $config)
{
if (isset($config['services'])) {
- /** @psalm-suppress MixedAssignment */
foreach ($config['services'] as $service) {
$this->validate($service);
}
diff --git a/src/Config.php b/src/Config.php
index f0ec9d5f..b7b6042c 100644
--- a/src/Config.php
+++ b/src/Config.php
@@ -94,11 +94,9 @@ public function toArray()
* @psalm-param ServiceManagerConfigurationType $a
* @psalm-param ServiceManagerConfigurationType $b
* @psalm-return ServiceManagerConfigurationType
- * @psalm-suppress MixedReturnTypeCoercion
*/
private function merge(array $a, array $b)
{
- /** @psalm-suppress MixedReturnTypeCoercion */
return ArrayUtils::merge($a, $b);
}
}