diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 25b43c3e..953a0654 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -229,8 +229,8 @@
- config[$type][self::LOADER])]]>
- config[$type][self::RELATION])]]>
+ new Autowire($loader)
+ new Autowire($relation)
@@ -297,9 +297,6 @@
],
)]]>
-
- $alias
-
$class
$class
diff --git a/src/Config/RelationConfig.php b/src/Config/RelationConfig.php
index d0b69792..10189a2e 100644
--- a/src/Config/RelationConfig.php
+++ b/src/Config/RelationConfig.php
@@ -61,19 +61,21 @@ public static function getDefault(): self
public function getLoader(int|string $type): Autowire
{
- if (!isset($this->config[$type][self::LOADER])) {
- throw new ConfigException("Unable to get relation loader `{$type}`.");
- }
+ $loader = $this->config[$type][self::LOADER] ?? throw new ConfigException(
+ "Unable to get relation loader `{$type}`.",
+ );
- return new Autowire($this->config[$type][self::LOADER]);
+ \assert(\is_string($loader) && $loader !== '');
+ return new Autowire($loader);
}
public function getRelation(int|string $type): Autowire
{
- if (!isset($this->config[$type][self::RELATION])) {
- throw new ConfigException("Unable to get relation `{$type}`.");
- }
+ $relation = $this->config[$type][self::RELATION] ?? throw new ConfigException(
+ "Unable to get relation `{$type}`.",
+ );
- return new Autowire($this->config[$type][self::RELATION]);
+ \assert(\is_string($relation) && $relation !== '');
+ return new Autowire($relation);
}
}