From 459d74dfaf1f974ed3ee3d651256cee56920e73c Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Tue, 27 Feb 2024 13:08:11 +0300 Subject: [PATCH] Renamed $templateArguments to $arguments --- src/DefaultTypeVisitor.php | 2 +- src/NamedObjectType.php | 6 +++--- src/TypeVisitor.php | 4 ++-- src/types.php | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/DefaultTypeVisitor.php b/src/DefaultTypeVisitor.php index f6a1b5f..cb18908 100644 --- a/src/DefaultTypeVisitor.php +++ b/src/DefaultTypeVisitor.php @@ -126,7 +126,7 @@ public function namedClassString(Type $self, Type $object): mixed return $this->default($self); } - public function namedObject(Type $self, string $class, array $templateArguments): mixed + public function namedObject(Type $self, string $class, array $arguments): mixed { return $this->default($self); } diff --git a/src/NamedObjectType.php b/src/NamedObjectType.php index 9967aa2..c34654c 100644 --- a/src/NamedObjectType.php +++ b/src/NamedObjectType.php @@ -13,15 +13,15 @@ final class NamedObjectType implements Type { /** * @param non-empty-string $class - * @param list $templateArguments + * @param list $arguments */ public function __construct( private readonly string $class, - private readonly array $templateArguments, + private readonly array $arguments, ) {} public function accept(TypeVisitor $visitor): mixed { - return $visitor->namedObject($this, $this->class, $this->templateArguments); + return $visitor->namedObject($this, $this->class, $this->arguments); } } diff --git a/src/TypeVisitor.php b/src/TypeVisitor.php index 035fba1..15bb519 100644 --- a/src/TypeVisitor.php +++ b/src/TypeVisitor.php @@ -151,10 +151,10 @@ public function namedClassString(Type $self, Type $object): mixed; /** * @param Type $self * @param non-empty-string $class - * @param list $templateArguments + * @param list $arguments * @return TReturn */ - public function namedObject(Type $self, string $class, array $templateArguments): mixed; + public function namedObject(Type $self, string $class, array $arguments): mixed; /** * @param Type $self diff --git a/src/types.php b/src/types.php index 7648f1d..4328cf2 100644 --- a/src/types.php +++ b/src/types.php @@ -344,13 +344,13 @@ public static function nullable(Type $type): Type * @param class-string|non-empty-string $class * @return ($class is class-string ? Type : Type) */ - public static function object(string $class, Type ...$templateArguments): Type + public static function object(string $class, Type ...$arguments): Type { - if ($class === \Closure::class && $templateArguments === []) { + if ($class === \Closure::class && $arguments === []) { return self::closure; } - return new NamedObjectType($class, array_values($templateArguments)); + return new NamedObjectType($class, array_values($arguments)); } /**