Skip to content

Commit 84eefef

Browse files
committed
rerun CI $this not strictly self
1 parent b54e4ef commit 84eefef

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,9 @@ public static function getTypeHintFromOneType(
386386
return 'object';
387387
}
388388

389+
// $this and self are not strictly equal
389390
if ($typeNode instanceof ThisTypeNode) {
390-
return 'self';
391+
return (string) $typeNode;
391392
}
392393

393394
if ($typeNode instanceof ConstTypeNode) {

tests/Sniffs/TypeHints/ReturnTypeHintSniffTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public function testWithUnionErrors(): void
156156
self::assertSniffError($report, 59, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
157157
self::assertSniffError($report, 63, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
158158
self::assertSniffError($report, 67, ReturnTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT);
159+
self::assertSniffError($report, 71, ReturnTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION);
159160

160161
self::assertAllFixedInFile($report);
161162
}

tests/Sniffs/TypeHints/data/returnTypeHintWithUnionErrors.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,8 @@ private function objectAndVoid()
6767
private function mixedAndVoid()
6868
{}
6969

70+
/** @return non-empty-array|null */
71+
public function returnNonEmptyArray(): ?array
72+
{}
73+
7074
}

tests/Sniffs/TypeHints/data/returnTypeHintWithUnionNoErrors.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,4 @@ public function returnCallableArray(): ?callable
4343
{
4444
}
4545

46-
/** @return non-empty-array|null */
47-
public function returnNonEmptyArray(): ?array
48-
{
49-
}
5046
}

0 commit comments

Comments
 (0)