Skip to content

Commit 27348e5

Browse files
committed
ReturnTypeHintSniff: More tests
1 parent 44bbe93 commit 27348e5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

tests/Sniffs/TypeHints/ReturnTypeHintSniffTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testWithUnionErrors(): void
104104
'traversableTypeHints' => ['Traversable', '\ArrayIterator'],
105105
]);
106106

107-
self::assertSame(15, $report->getErrorCount());
107+
self::assertSame(16, $report->getErrorCount());
108108

109109
self::assertSniffError($report, 7, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
110110
self::assertSniffError($report, 11, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
@@ -122,6 +122,7 @@ public function testWithUnionErrors(): void
122122
self::assertSniffError($report, 55, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
123123
self::assertSniffError($report, 59, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
124124
self::assertSniffError($report, 63, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
125+
self::assertSniffError($report, 67, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
125126

126127
self::assertAllFixedInFile($report);
127128
}

tests/Sniffs/TypeHints/data/returnTypeHintWithUnionErrors.fixed.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ private function scalarAndnumericNullable(): string|int|float|bool|null
6363
private function objectAndVoid(): object|null
6464
{}
6565

66+
/***/
67+
private function mixedAndVoid(): mixed
68+
{}
69+
6670
}

tests/Sniffs/TypeHints/data/returnTypeHintWithUnionErrors.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ private function scalarAndnumericNullable()
6363
private function objectAndVoid()
6464
{}
6565

66+
/** @return mixed|void */
67+
private function mixedAndVoid()
68+
{}
69+
6670
}

0 commit comments

Comments
 (0)