Skip to content

Commit

Permalink
Renamed $templateArguments to $arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Feb 27, 2024
1 parent 683da58 commit 459d74d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/DefaultTypeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/NamedObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ final class NamedObjectType implements Type
{
/**
* @param non-empty-string $class
* @param list<Type> $templateArguments
* @param list<Type> $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);
}
}
4 changes: 2 additions & 2 deletions src/TypeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public function namedClassString(Type $self, Type $object): mixed;
/**
* @param Type<object> $self
* @param non-empty-string $class
* @param list<Type> $templateArguments
* @param list<Type> $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<never> $self
Expand Down
6 changes: 3 additions & 3 deletions src/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ public static function nullable(Type $type): Type
* @param class-string<TObject>|non-empty-string $class
* @return ($class is class-string ? Type<TObject> : Type<object>)
*/
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));
}

/**
Expand Down

0 comments on commit 459d74d

Please sign in to comment.