mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +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
|
||||
*
|
||||
* @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) {}
|
||||
|
||||
|
@ -271,8 +271,8 @@ class MethodCallTest extends TestCase
|
||||
|
||||
$b = (new DateTimeImmutable())->modify("+3 hours");',
|
||||
'assertions' => [
|
||||
'$yesterday' => 'MyDate',
|
||||
'$b' => 'DateTimeImmutable',
|
||||
'$yesterday' => 'MyDate|false',
|
||||
'$b' => 'DateTimeImmutable|false',
|
||||
],
|
||||
],
|
||||
'magicCall' => [
|
||||
|
Loading…
Reference in New Issue
Block a user