1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

add null to tests to fix invalid return type

This commit is contained in:
kkmuffme 2023-01-03 23:08:39 +01:00
parent b85d6374fe
commit 25cadb6776
4 changed files with 14 additions and 4 deletions

View File

@ -56,7 +56,9 @@ class MagicMethodAnnotationTest extends TestCase
/** @template T */
class A {
/** @return ?T */
public function find() {}
public function find() {
return null;
}
}
/** @psalm-suppress MissingTemplateParam */

View File

@ -1256,7 +1256,9 @@ class StubTest extends TestCase
* @param ?int $lockVersion
* @return mixed
*/
public function find($id, $lockMode = null, $lockVersion = null) {}
public function find($id, $lockMode = null, $lockVersion = null) {
return null;
}
}
/**

View File

@ -590,7 +590,9 @@ class ClassTemplateExtendsTest extends TestCase
/** @template T1 */
class Repo {
/** @return ?T1 */
public function findOne() {}
public function findOne() {
return null;
}
}
class SpecificEntity {}
@ -610,7 +612,9 @@ class ClassTemplateExtendsTest extends TestCase
/** @template T1 */
class Repo {
/** @return ?T1 */
public function findOne() {}
public function findOne() {
return null;
}
}
/**

View File

@ -348,6 +348,8 @@ class ConditionalTest extends TestCase
takesAandI($this);
takesIandA($this);
}
return null;
}
protected function bar(): void {}