protected function parseMiddlewareToPipelines(array $middlewares) : array
    {
        $pipes = [];
        // check all types and store value into pipes array
        foreach ($middlewares as $middleware) {
            if (is_object($middleware)) {
                $pipes[] = $middleware;
            } elseif (string_has($middleware, ':')) {
                $pipes[] = $middleware;
            } else {
                $pipes[] = $this->container->make($middleware);
            }
        }

        return $pipes;
    }