mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +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 */
|
/** @template T */
|
||||||
class A {
|
class A {
|
||||||
/** @return ?T */
|
/** @return ?T */
|
||||||
public function find() {}
|
public function find() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress MissingTemplateParam */
|
/** @psalm-suppress MissingTemplateParam */
|
||||||
|
@ -1256,7 +1256,9 @@ class StubTest extends TestCase
|
|||||||
* @param ?int $lockVersion
|
* @param ?int $lockVersion
|
||||||
* @return mixed
|
* @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 */
|
/** @template T1 */
|
||||||
class Repo {
|
class Repo {
|
||||||
/** @return ?T1 */
|
/** @return ?T1 */
|
||||||
public function findOne() {}
|
public function findOne() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SpecificEntity {}
|
class SpecificEntity {}
|
||||||
@ -610,7 +612,9 @@ class ClassTemplateExtendsTest extends TestCase
|
|||||||
/** @template T1 */
|
/** @template T1 */
|
||||||
class Repo {
|
class Repo {
|
||||||
/** @return ?T1 */
|
/** @return ?T1 */
|
||||||
public function findOne() {}
|
public function findOne() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -348,6 +348,8 @@ class ConditionalTest extends TestCase
|
|||||||
takesAandI($this);
|
takesAandI($this);
|
||||||
takesIandA($this);
|
takesIandA($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function bar(): void {}
|
protected function bar(): void {}
|
||||||
|
Loading…
Reference in New Issue
Block a user