Skip to content

Commit d60b561

Browse files
committed
don't throw exceptions on superfluous type docs
1 parent 2f8a1dd commit d60b561

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

build/gen_stub.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,6 @@ public function getDefaultValueAsMethodSynopsisString(): ?string {
733733

734734
private function setTypes(?Type $type, ?Type $phpDocType): void
735735
{
736-
if ($phpDocType !== null && Type::equals($type, $phpDocType)) {
737-
throw new Exception('PHPDoc param type "' . $phpDocType->__toString() . '" is unnecessary');
738-
}
739-
740736
$this->type = $type;
741737
$this->phpDocType = $phpDocType;
742738
}
@@ -910,10 +906,6 @@ public function getMethodSynopsisType(): ?Type {
910906

911907
private function setTypes(?Type $type, ?Type $phpDocType, bool $tentativeReturnType): void
912908
{
913-
if ($phpDocType !== null && Type::equals($type, $phpDocType)) {
914-
throw new Exception('PHPDoc return type "' . $phpDocType->__toString() . '" is unnecessary');
915-
}
916-
917909
$this->type = $type;
918910
$this->phpDocType = $phpDocType;
919911
$this->tentativeReturnType = $tentativeReturnType;

0 commit comments

Comments
 (0)