Skip to content

Commit

Permalink
move psalm validation error suppression for the RedisCluster construc…
Browse files Browse the repository at this point in the history
…tor to the code

Signed-off-by: robin-brabants <[email protected]>
Co-authored-by: robin-brabants <[email protected]>
  • Loading branch information
boesing and robin-brabants committed Apr 10, 2024
1 parent 66802c7 commit adab911
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@
<directory name="*"/>
</errorLevel>
</RedundantCastGivenDocblockType>
<!--
Psalm currently (<= 5.23.1) uses an outdated (phpredis < 5.3.2) constructor signature for the RedisCluster
class in the phpredis extension.
-->
<TooManyArguments>
<errorLevel type="suppress">
<referencedFunction name="RedisCluster::__construct"/>
</errorLevel>
</TooManyArguments>
</issueHandlers>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
Expand Down
12 changes: 12 additions & 0 deletions src/RedisClusterResourceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ private function createRedisResource(RedisClusterOptions $options): RedisCluster
$password = null;
}

/**
* Psalm currently (<= 5.23.1) uses an outdated (phpredis < 5.3.2) constructor signature for the RedisCluster
* class in the phpredis extension.
*
* @psalm-suppress TooManyArguments https://github.com/vimeo/psalm/pull/10862
*/
return new RedisClusterFromExtension(
null,
$options->getSeeds(),
Expand Down Expand Up @@ -119,6 +125,12 @@ private function createRedisResourceFromName(
$readTimeout = $options->getReadTimeout($name, $fallbackReadTimeout);
$password = $options->getPasswordByName($name, $fallbackPassword);

/**
* Psalm currently (<= 5.23.1) uses an outdated (phpredis < 5.3.2) constructor signature for the RedisCluster
* class in the phpredis extension.
*
* @psalm-suppress TooManyArguments https://github.com/vimeo/psalm/pull/10862
*/
return new RedisClusterFromExtension(
null,
$seeds,
Expand Down

0 comments on commit adab911

Please sign in to comment.