1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Merge pull request #8102 from bitwise-operators/8096-createFromInterface-return-type

Change return type of createFromInterface() on DateTime and DateTimeImmutable to static
This commit is contained in:
orklah 2022-06-13 23:05:15 +02:00 committed by GitHub
commit 10ea05a5a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -1780,7 +1780,7 @@ return [
'DateTime::add' => ['static', 'interval'=>'DateInterval'],
'DateTime::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTime::createFromImmutable' => ['static', 'object'=>'DateTimeImmutable'],
'DateTime::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTime::createFromInterface' => ['static', 'object' => 'DateTimeInterface'],
'DateTime::diff' => ['DateInterval|false', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTime::format' => ['string', 'format'=>'string'],
'DateTime::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
@ -1800,7 +1800,7 @@ return [
'DateTimeImmutable::__wakeup' => ['void'],
'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTimeImmutable::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromInterface' => ['static', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string', 'format'=>'string'],

View File

@ -16,8 +16,8 @@
*/
return [
'added' => [
'DateTime::createFromInterface' => ['self', 'object'=>'DateTimeInterface'],
'DateTimeImmutable::createFromInterface' => ['self', 'object'=>'DateTimeInterface'],
'DateTime::createFromInterface' => ['static', 'object'=>'DateTimeInterface'],
'DateTimeImmutable::createFromInterface' => ['static', 'object'=>'DateTimeInterface'],
'PhpToken::getTokenName' => ['string'],
'PhpToken::is' => ['bool', 'kind'=>'string|int|string[]|int[]'],
'PhpToken::isIgnorable' => ['bool'],

View File

@ -974,7 +974,7 @@ class MethodCallTest extends TestCase
class Datetime extends \DateTime
{
public static function createFromInterface(\DatetimeInterface $datetime): \DateTime
public static function createFromInterface(\DatetimeInterface $datetime): static
{
return parent::createFromInterface($datetime);
}