Defining a event listeners in the config for the AuthorizationServerFactory without a priority or with a priority that isn't a string is incorrect as per the signature of `League\Event\ListenerAcceptorInterface::addListener()' which is:
/**
* Add a listener for an event.
*
* [...]
*
* @param string $event
* @param ListenerInterface|callable $listener
* @param int $priority
*
* @return $this
*/
public function addListener($event, $listener, $priority = self::P_NORMAL);
More importantly, if $priority is set to null (as is the default) then the error message "ArgumentCountError array_merge() does not accept unknown named parameters" is raised in League\Event\Emitter::getSortedListeners()
This PR sets the default priority to zero if it is not set in config and will throw an exception if a non-integer is configured for this property.
Description
Defining a event listeners in the config for the
AuthorizationServerFactory
without a priority or with a priority that isn't a string is incorrect as per the signature of `League\Event\ListenerAcceptorInterface::addListener()' which is:More importantly, if
$priority
is set to null (as is the default) then the error message"ArgumentCountError array_merge() does not accept unknown named parameters"
is raised inLeague\Event\Emitter::getSortedListeners()
This PR sets the default priority to zero if it is not set in config and will throw an exception if a non-integer is configured for this property.
Fixes in #63.
Thanks @cardcc for the excellent report.