Skip to content

Commit

Permalink
Simplify templates for get()
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Jan 9, 2024
1 parent be509ec commit 68627d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
<code>get</code>
</MethodSignatureMustProvideReturnType>
<MixedInferredReturnType>
<code><![CDATA[($name is class-string<T1> ? T1 : ($name is class-string<T2> ? T2 : T1|T2))]]></code>
<code><![CDATA[($name is class-string<T> ? T : InputInterface|InputFilterInterface)]]></code>
</MixedInferredReturnType>
<MixedReturnStatement>
<code>parent::get($name, $options)</code>
Expand Down
8 changes: 3 additions & 5 deletions src/InputFilterPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,9 @@ public function validatePlugin($plugin)

/**
* @inheritDoc
* @template T1 of InputInterface
* @template T2 of InputFilterInterface
* @param class-string<T1>|class-string<T2>|string $name
* @return T1|T2
* @psalm-return ($name is class-string<T1> ? T1 : ($name is class-string<T2> ? T2 : T1|T2))
* @template T of InputInterface|InputFilterInterface
* @param class-string<T>|string $name
* @return ($name is class-string<T> ? T : InputInterface|InputFilterInterface)
*/
public function get($name, ?array $options = null)
{
Expand Down

0 comments on commit 68627d4

Please sign in to comment.