mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
Merge pull request #9009 from weirdan/allow-no-return-type-on-destructors
Fixes https://github.com/vimeo/psalm/issues/9008
This commit is contained in:
commit
9f5314b146
@ -139,6 +139,7 @@ class InterfaceAnalyzer extends ClassLikeAnalyzer
|
||||
$actual_method_id = $method_analyzer->getMethodId();
|
||||
|
||||
if ($stmt->name->name !== '__construct'
|
||||
&& $stmt->name->name !== '__destruct'
|
||||
&& $config->reportIssueInFile('InvalidReturnType', $this->getFilePath())
|
||||
) {
|
||||
ClassAnalyzer::analyzeClassMethodReturnType(
|
||||
|
@ -916,6 +916,19 @@ class MethodSignatureTest extends TestCase
|
||||
public function a(mixed $a): void {}
|
||||
}',
|
||||
],
|
||||
'doesNotRequireInterfaceDestructorsToHaveReturnType' => [
|
||||
'code' => '<?php
|
||||
interface I
|
||||
{
|
||||
public function __destruct();
|
||||
}
|
||||
|
||||
class C implements I
|
||||
{
|
||||
public function __destruct() {}
|
||||
}
|
||||
',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user