private function getTypes($middleware)
    {
        $types = [];

        if ($middleware instanceof PrepareableInterface) {
            $types[] = 'prepareable';
        }
        if ($middleware instanceof RespondableInterface) {
            $types[] = 'respondable';
        }
        if ($middleware instanceof CloseableInterface) {
            $types[] = 'closeable';
        }

        return $types;
    }