mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Simplified DateTimeImmutable::format()
: always returns a string
Also: * a non-empty format string will always lead to `non-empty-string` * it seems that you can throw **everything** at `DateTimeInterface#format()`, even null bytes, and it will always produce a `string`
This commit is contained in:
parent
a1ed84f1ed
commit
68ffae097e
@ -15,7 +15,7 @@ class DateTimeImmutable implements DateTimeInterface
|
|||||||
*
|
*
|
||||||
* @param string $format
|
* @param string $format
|
||||||
*
|
*
|
||||||
* @return (\PHP_MAJOR_VERSION is int<0, 7> ? string|false : string)
|
* @return ($format is non-empty-string ? non-empty-string : string)
|
||||||
*/
|
*/
|
||||||
public function format($format) {}
|
public function format($format) {}
|
||||||
|
|
||||||
|
@ -271,8 +271,8 @@ class MethodCallTest extends TestCase
|
|||||||
|
|
||||||
$b = (new DateTimeImmutable())->modify("+3 hours");',
|
$b = (new DateTimeImmutable())->modify("+3 hours");',
|
||||||
'assertions' => [
|
'assertions' => [
|
||||||
'$yesterday' => 'MyDate',
|
'$yesterday' => 'MyDate|false',
|
||||||
'$b' => 'DateTimeImmutable',
|
'$b' => 'DateTimeImmutable|false',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'magicCall' => [
|
'magicCall' => [
|
||||||
|
Loading…
Reference in New Issue
Block a user