Skip to content

Commit

Permalink
Narrow types using annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 5, 2023
1 parent a8d7081 commit 9627211
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Event/Dispatcher/DirectDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class DirectDispatcher implements SubscribableDispatcher
private readonly TypeMap $typeMap;

/**
* @psalm-var array<string, list<Subscriber>>
* @psalm-var array<class-string, list<Subscriber>>
*/
private array $subscribers = [];

Expand Down
2 changes: 2 additions & 0 deletions src/Event/TypeMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public function isKnownEventType(Event $event): bool
}

/**
* @psalm-return class-string
*
* @throws MapError
*/
public function map(Subscriber $subscriber): string
Expand Down

0 comments on commit 9627211

Please sign in to comment.