Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use template parameter in return type. #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Event/ControllerArgumentsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ public function getNamedArguments(): array
}

/**
* @template T of class-string|null
* @template T of object
*
* @param T $className
* @param class-string<T>|null $className
*
* @return array<class-string, list<object>>|list<object>
* @return array<class-string, list<object>>|list<T>
*
* @psalm-return (T is null ? array<class-string, list<object>> : list<object>)
* @psalm-return (T is null ? array<class-string, list<object>> : list<T>)
*/
public function getAttributes(?string $className = null): array
{
Expand Down
8 changes: 4 additions & 4 deletions Event/ControllerEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public function setController(callable $controller, ?array $attributes = null):
}

/**
* @template T of class-string|null
* @template T of object
*
* @param T $className
* @param class-string<T>|null $className
*
* @return array<class-string, list<object>>|list<object>
* @return array<class-string, list<object>>|list<T>
*
* @psalm-return (T is null ? array<class-string, list<object>> : list<object>)
* @psalm-return (T is null ? array<class-string, list<object>> : list<T>)
*/
public function getAttributes(?string $className = null): array
{
Expand Down