public function registerHandlers(array $handlers)
    {
        foreach ($handlers as $type => $handler) {
            if (!is_string($type)) {
                // Probably, non-string $type is a numeric index, which means,
                // that the handler array was defined as [ $handler1, $handler2, ... ] without handler types.
                // So try to guess the type.
                $type = $this->guessHandlerType($handler);
            }

            $this->registerHandler($handler, $type);
        }

        return $this;
    }