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:
parent
b85d6374fe
commit
25cadb6776
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -348,6 +348,8 @@ class ConditionalTest extends TestCase
|
||||
takesAandI($this);
|
||||
takesIandA($this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function bar(): void {}
|
||||
|
Loading…
Reference in New Issue
Block a user