File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 229
229
</file >
230
230
<file src =" src/Config/RelationConfig.php" >
231
231
<TooManyArguments >
232
- <code ><![CDATA[ new Autowire($this->config[$type][self::LOADER]) ]]> </code >
233
- <code ><![CDATA[ new Autowire($this->config[$type][self::RELATION]) ]]> </code >
232
+ <code >new Autowire($loader) </code >
233
+ <code >new Autowire($relation) </code >
234
234
</TooManyArguments >
235
235
</file >
236
236
<file src =" src/EntityManager.php" >
297
297
],
298
298
)]]> </code >
299
299
</LessSpecificReturnStatement >
300
- <MethodSignatureMismatch >
301
- <code >$alias</code >
302
- </MethodSignatureMismatch >
303
300
<MixedArgument >
304
301
<code >$class</code >
305
302
<code >$class</code >
Original file line number Diff line number Diff line change @@ -61,19 +61,21 @@ public static function getDefault(): self
61
61
62
62
public function getLoader (int |string $ type ): Autowire
63
63
{
64
- if (! isset ( $ this ->config [$ type ][self ::LOADER ])) {
65
- throw new ConfigException ( "Unable to get relation loader ` {$ type }`. " );
66
- }
64
+ $ loader = $ this ->config [$ type ][self ::LOADER ] ?? throw new ConfigException (
65
+ "Unable to get relation loader ` {$ type }`. " ,
66
+ );
67
67
68
- return new Autowire ($ this ->config [$ type ][self ::LOADER ]);
68
+ \assert (\is_string ($ loader ));
69
+ return new Autowire ($ loader );
69
70
}
70
71
71
72
public function getRelation (int |string $ type ): Autowire
72
73
{
73
- if (! isset ( $ this ->config [$ type ][self ::RELATION ])) {
74
- throw new ConfigException ( "Unable to get relation ` {$ type }`. " );
75
- }
74
+ $ relation = $ this ->config [$ type ][self ::RELATION ] ?? throw new ConfigException (
75
+ "Unable to get relation ` {$ type }`. " ,
76
+ );
76
77
77
- return new Autowire ($ this ->config [$ type ][self ::RELATION ]);
78
+ \assert (\is_string ($ relation ));
79
+ return new Autowire ($ relation );
78
80
}
79
81
}
You can’t perform that action at this time.
0 commit comments