Skip to content

Commit

Permalink
Suppress RedundantCondition in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Sep 2, 2024
1 parent fd9bc92 commit b0d880c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 10 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
<directory name="tests"/>
</errorLevel>
</PossiblyUnusedMethod>
<RedundantCondition>
<errorLevel type="suppress">
<directory name="tests"/>
</errorLevel>
</RedundantCondition>
<RedundantConditionGivenDocblockType>
<errorLevel type="suppress">
<directory name="tests"/>
</errorLevel>
</RedundantConditionGivenDocblockType>
<UnusedConstructor errorLevel="suppress"/>
</issueHandlers>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function testInternalClassesViaNativeReflector(string $name): void

private static function assertFunctionEquals(\ReflectionFunction $native, \ReflectionFunction $typhoon, string $messagePrefix = 'function'): void
{
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), "isset({$messagePrefix}.name)");
self::assertSame($native->name, $typhoon->name, $messagePrefix . '.name');
self::assertSame($native->__toString(), $typhoon->__toString(), $messagePrefix . '.__toString()');
Expand Down Expand Up @@ -146,7 +145,6 @@ private static function assertFunctionEquals(\ReflectionFunction $native, \Refle

private static function assertClassEquals(\ReflectionClass $native, \ReflectionClass $typhoon): void
{
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), 'isset(class.name)');
self::assertSame($native->name, $typhoon->name, 'class.name');
self::assertSame($native->__toString(), $typhoon->__toString(), 'class.__toString()');
Expand Down Expand Up @@ -285,7 +283,6 @@ private static function assertClassEquals(\ReflectionClass $native, \ReflectionC
private static function assertConstantEquals(\ReflectionClassConstant $native, \ReflectionClassConstant $typhoon, string $messagePrefix): void
{
self::assertSame($native->class, $typhoon->class, $messagePrefix . '.class');
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), "isset({$messagePrefix}.name)");
self::assertSame($native->name, $typhoon->name, $messagePrefix . '.name');
self::assertSame($native->__toString(), $typhoon->__toString(), $messagePrefix . '.__toString()');
Expand Down Expand Up @@ -325,7 +322,6 @@ private static function assertConstantEquals(\ReflectionClassConstant $native, \
private static function assertPropertyEquals(\ReflectionProperty $native, \ReflectionProperty $typhoon, string $messagePrefix): void
{
self::assertSame($native->class, $typhoon->class, $messagePrefix . '.class');
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), "isset({$messagePrefix}.name)");
self::assertSame($native->name, $typhoon->name, $messagePrefix . '.name');
self::assertSame($native->__toString(), $typhoon->__toString(), $messagePrefix . '.__toString()');
Expand Down Expand Up @@ -353,7 +349,6 @@ private static function assertPropertyEquals(\ReflectionProperty $native, \Refle
private static function assertMethodEquals(\ReflectionMethod $native, \ReflectionMethod $typhoon, string $messagePrefix): void
{
self::assertSame($native->class, $typhoon->class, $messagePrefix . '.class');
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), "isset({$messagePrefix}.name)");
self::assertSame($native->name, $typhoon->name, $messagePrefix . '.name');
self::assertSame($native->__toString(), $typhoon->__toString(), $messagePrefix . '.__toString()');
Expand Down Expand Up @@ -431,7 +426,6 @@ private static function assertParametersEqual(array $native, array $typhoon, str

private static function assertParameterEquals(\ReflectionParameter $native, \ReflectionParameter $typhoon, string $messagePrefix, bool $assertType = true): void
{
/** @psalm-suppress RedundantCondition */
self::assertTrue(isset($typhoon->name), "isset({$messagePrefix}.name)");
self::assertSame($native->name, $typhoon->name, $messagePrefix . '.name');
self::assertSame($native->__toString(), $typhoon->__toString(), $messagePrefix . '.__toString()');
Expand Down

0 comments on commit b0d880c

Please sign in to comment.