mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
Removed DateTimeImmutable::setTimestamp()
from the CallMap: fully covered by stub
Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.1.x):32d55f7422/ext/date/php_date.c (L3353-L3369)
Ref (PHP 7.0.33):bf574c2b67/ext/date/php_date.c (L3596-L3612)
This commit is contained in:
parent
964f64a500
commit
aaac9ccb90
@ -1798,7 +1798,6 @@ return [
|
||||
'DateTimeImmutable::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
|
||||
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
|
||||
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
|
||||
'DateTimeImmutable::setTimestamp' => ['static|false', 'unixtimestamp'=>'int'],
|
||||
'DateTimeInterface::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
|
||||
'DateTimeInterface::format' => ['string', 'format'=>'string'],
|
||||
'DateTimeInterface::getOffset' => ['int'],
|
||||
|
@ -1059,7 +1059,6 @@ return [
|
||||
'DateTimeImmutable::__wakeup' => ['void'],
|
||||
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
|
||||
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
|
||||
'DateTimeImmutable::setTimestamp' => ['static|false', 'unixtimestamp'=>'int'],
|
||||
'DateTimeInterface::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
|
||||
'DateTimeInterface::format' => ['string', 'format'=>'string'],
|
||||
'DateTimeInterface::getOffset' => ['int'],
|
||||
|
@ -91,7 +91,7 @@ class DateTimeImmutable implements DateTimeInterface
|
||||
|
||||
/**
|
||||
* @psalm-mutation-free
|
||||
* @return static|false
|
||||
* @return static
|
||||
*/
|
||||
public function setTimestamp(int $unixtimestamp) {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user