1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Fix tests

This commit is contained in:
Matt Brown 2020-10-27 22:29:49 -04:00 committed by Daniil Gentili
parent 35fd64bf74
commit 951c3715f7
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 14 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Emitted when a `__toString` method does not always return a `string`
class A {
public function __toString() {
/** @psalm-suppress InvalidReturnStatement */
return true;
}
}

View File

@ -219,6 +219,19 @@ class ToStringTest extends TestCase
}',
'error_message' => 'InvalidToString',
],
'invalidInferredToStringReturnTypeWithTruePhp8' => [
'<?php
class A {
function __toString() {
/** @psalm-suppress InvalidReturnStatement */
return true;
}
}',
'error_message' => 'InvalidToString',
[],
false,
'8.0'
],
'implicitCastWithStrictTypes' => [
'<?php declare(strict_types=1);
class A {