public function register(callable $callback, $priority = null)
    {
        $priority = $this->getPriority($priority);
        if (!isset($this->callbacks[$priority])) {
            $this->callbacks[$priority] = [];
        }
        $this->callbacks[$priority][] = $callback;
        $this->lowestPriority = max($priority, $this->lowestPriority);
    }