private function registerImpl(
    /*string*/ $id,
    callable $callback,
    /*int*/ $priority
  ) {
    // Initialize array for this priority.
    if(!isset($this->callbacks[$priority])) {
      $this->callbacks[$priority] = [];
    }

    // Keep a pointer to the callback and what priority it is.
    $this->priorities[$id] = $priority;
    $this->callbacks[$priority][$id] = $callback;
  }