mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +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:
commit
10ea05a5a3
@ -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'],
|
||||
|
@ -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'],
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user