Skip to content

Commit

Permalink
Merge pull request #8102 from bitwise-operators/8096-createFromInterf…
Browse files Browse the repository at this point in the history
…ace-return-type

Change return type of createFromInterface() on DateTime and DateTimeImmutable to static
  • Loading branch information
orklah committed Jun 13, 2022
2 parents eb1ef40 + 651ad6c commit 10ea05a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dictionaries/CallMap.php
Expand Up @@ -1780,7 +1780,7 @@
'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>}'],
Expand All @@ -1800,7 +1800,7 @@
'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'],
Expand Down
4 changes: 2 additions & 2 deletions dictionaries/CallMap_80_delta.php
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion tests/MethodCallTest.php
Expand Up @@ -974,7 +974,7 @@ public static function new() : self {
class Datetime extends \DateTime
{
public static function createFromInterface(\DatetimeInterface $datetime): \DateTime
public static function createFromInterface(\DatetimeInterface $datetime): static
{
return parent::createFromInterface($datetime);
}
Expand Down

0 comments on commit 10ea05a

Please sign in to comment.