protected function resolveAuth(array $parameters, array $headers)
    {
        isset($parameters['PHP_AUTH_USER']) ? $this->resolvePHPAuth($parameters, $headers) : $this->resolveHTTPAuth($parameters, $headers);

        if (isset($headers['PHP_AUTH_USER'])) {
            $headers['AUTHORIZATION'] = 'basic ' . base64_encode($headers['PHP_AUTH_USER'] . ':' . $headers['PHP_AUTH_PW']);
        }

        return $headers;
    }