Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/cache/*
!/cache/.gitkeep
/.idea
/.vscode
/phpstan.neon
/composer.phar
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private function comparePhpDocAndNativeType(
return [];
}

if ($nativeReturnType instanceof MixedType) {
if ($nativeReturnType instanceof MixedType || $nativeReturnType->isVoid()->yes()) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ForbidPhpDocNotMatchingNativeTypehintRule;

use Exception;

class HelloWorld
{
Expand Down Expand Up @@ -105,4 +106,12 @@ public static function getStringMissingNull($stringOrNullInTemplate): ?string //
return $stringOrNullInTemplate;
}

/**
* @return never
*/
public function throwSomeException(): void
{
throw new Exception();
}

}