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

Removed DateTimeImmutable::format() from the CallMap: fully covered by stub

Note: some conditional return type magic was required here.

See: https://github.com/vimeo/psalm/pull/8350#discussion_r937089212
This commit is contained in:
Marco Pivetta 2022-08-05 12:24:35 +02:00
parent 58ca4e0b73
commit 7ee12c7493
4 changed files with 3 additions and 7 deletions

View File

@ -1799,7 +1799,6 @@ return [
'DateTimeImmutable::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string', 'format'=>'string'],
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'DateTimeImmutable::getOffset' => ['int'],
'DateTimeImmutable::getTimestamp' => ['int|false'],

View File

@ -41,10 +41,6 @@ return [
'old' => ['string|false', 'format'=>'string'],
'new' => ['string', 'format'=>'string'],
],
'DateTimeImmutable::format' => [
'old' => ['string|false', 'format'=>'string'],
'new' => ['string', 'format'=>'string'],
],
'DateTimeZone::listIdentifiers' => [
'old' => ['list<string>|false', 'timezoneGroup='=>'int', 'countryCode='=>'string|null'],
'new' => ['list<string>', 'timezoneGroup='=>'int', 'countryCode='=>'string|null'],

View File

@ -1060,7 +1060,6 @@ return [
'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string|false', 'format'=>'string'],
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'DateTimeImmutable::getOffset' => ['int'],
'DateTimeImmutable::getTimestamp' => ['int|false'],

View File

@ -12,8 +12,10 @@ class DateTimeImmutable implements DateTimeInterface
/**
* @psalm-mutation-free
*
* @param string $format
* @return string
*
* @return (\PHP_MAJOR_VERSION is int<0, 7> ? string|false : string)
*/
public function format($format) {}