public function addHandler(HandlerInterface $handler, $priority = 0)
    {
        if (filter_var($priority, FILTER_VALIDATE_INT) === false) {
            throw new InvalidArgumentException("Argument 'priority' should be an integer, got '$priority'");
        }

        if ($this->handlerAlreadyRegistered($handler)) {
            return;
        }

        $this->handlers[$priority][] = $handler;
    }
public function addHandler(HandlerInterface $handler, $priority = 0)
    {
        if (filter_var($priority, FILTER_VALIDATE_INT) === false) {
            throw new InvalidArgumentException("Argument 'priority' should be an integer, got '$priority'");
        }

        if ($this->handlerAlreadyRegistered($handler)) {
            return;
        }

        $this->handlers[$priority][] = $handler;
    }
public function addHandler ( HandlerInterface $ handler , $ priority = 0 ) { if ( filter_var ( $ priority , FILTER_VALIDATE_INT ) === false ) { throw new InvalidArgumentException ( "Argument 'priority' should be an integer, got '$priority'" ) ; } if ( $ this -> handlerAlreadyRegistered ( $ handler ) ) { return ; } $ this -> handlers [ $ priority ] [ ] = $ handler ; }
Registers a new handler in the list

@param HandlerInterface $handler
@param int $priority the higher the number the higher the priority
@throws InvalidArgumentException
Registers a new handler in the list