Skip to content

Commit

Permalink
Allow addListener to work with strings, fixes composer#10672
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and emahorvat52 committed Jan 18, 2023
1 parent a0181c6 commit e00e7af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Composer/EventDispatcher/EventDispatcher.php
Expand Up @@ -401,13 +401,13 @@ protected function executeEventPhpScript(string $className, string $methodName,
/**
* Add a listener for a particular event
*
* @param string $eventName The event name - typically a constant
* @param callable $listener A callable expecting an event argument
* @param int $priority A higher value represents a higher priority
* @param string $eventName The event name - typically a constant
* @param callable|string $listener A callable expecting an event argument, or a command string to be executed (same as a composer.json "scripts" entry)
* @param int $priority A higher value represents a higher priority
*
* @return void
*/
public function addListener(string $eventName, callable $listener, int $priority = 0): void
public function addListener(string $eventName, $listener, int $priority = 0): void
{
$this->listeners[$eventName][$priority][] = $listener;
}
Expand Down

0 comments on commit e00e7af

Please sign in to comment.