Create a new instance as 'not modified'

This will remove any body contents set the status code
to "304" and removing headers that describe
a response body.

@return static
965831
public function withNotModified()
    {
        $new = $this->withStatus(304);
        $new->_createStream();
        $remove = [
            'Allow',
            'Content-Encoding',
            'Content-Language',
            'Content-Length',
            'Content-MD5',
            'Content-Type',
            'Last-Modified'
        ];
        foreach ($remove as $header) {
            $new = $new->withoutHeader($header);
        }

        return $new;
    }
537106
public function create(): self
    {
        $this->payload = null;
        $this->isPayloadDetached = false;
        $this->signatures = [];
        $this->isPayloadEncoded = null;

        return $this;
    }
1019655
public function createLogoutResponse()
    {
        return (new LogoutResponse())
            ->setStatus(new Status(new StatusCode(SamlConstants::STATUS_SUCCESS)))
            ->setID(Helper::generateID())
            ->setVersion(SamlConstants::VERSION_20)
            ->setIssuer(new Issuer($this->getMetadata()->getServiceProvider()->getEntityID()))
            ->setIssueInstant(new \DateTime());
    }
110478
public function reset()
    {
        $this->_headers->clearHeaders();
        $this->params = [];
        $this->postRawData = null;
        $this->httpClient->reset();
        return $this;
    }
1187501
public function clearAction()
    {
        if (!$this->checkLivePermissionForAllWebspaces()) {
            return new JsonResponse(null, 403);
        }

        $this->get('sulu_website.http_cache.clearer')->clear();

        return new JsonResponse(null, 204);
    }
365877
public function createResponse()
    {
        $response = $this->format();
        $response->headers->set('content-type', $this->getContentType());
        $response->setStatusCode($this->getStatusCode());
        $response->setCharset('UTF-8');

        return $response;
    }
1309078
public function response($version, $status, $reason, $headers = array(), $body = '')
    {
        return new Response($status, $headers, $this->body($body), $version, $reason);
    }
34807
static function make($body, $statusCode = 200)
    {
        $r = new Response();
        $r = $r->withStatus($statusCode);
        $r->getBody()->write($body);
        return $r;
    }
952541
protected function _prepareBody()
    {
        // According to RFC2616, a TRACE request should not have a body.
        if ($this->method == self::TRACE) {
            return '';
        }

        if (isset($this->raw_post_data) && is_resource($this->raw_post_data)) {
            return $this->raw_post_data;
        }
        // If mbstring overloads substr and strlen functions, we have to
        // override it's internal encoding
        if (function_exists('mb_internal_encoding') &&
           ((int) ini_get('mbstring.func_overload')) & 2) {

            $mbIntEnc = mb_internal_encoding();
            mb_internal_encoding('ASCII');
        }

        // If we have raw_post_data set, just use it as the body.
        if (isset($this->raw_post_data)) {
            $this->setHeaders(self::CONTENT_LENGTH, strlen($this->raw_post_data));
            if (isset($mbIntEnc)) {
                mb_internal_encoding($mbIntEnc);
            }

            return $this->raw_post_data;
        }

        $body = '';

        // If we have files to upload, force enctype to multipart/form-data
        if (count ($this->files) > 0) {
            $this->setEncType(self::ENC_FORMDATA);
        }

        // If we have POST parameters or files, encode and add them to the body
        if (count($this->paramsPost) > 0 || count($this->files) > 0) {
            switch($this->enctype) {
                case self::ENC_FORMDATA:
                    // Encode body as multipart/form-data
                    $boundary = '---ZENDHTTPCLIENT-' . md5(microtime());
                    $this->setHeaders(self::CONTENT_TYPE, self::ENC_FORMDATA . "; boundary={$boundary}");

                    // Encode all files and POST vars in the order they were given
                    foreach ($this->body_field_order as $fieldName=>$fieldType) {
                        switch ($fieldType) {
                            case self::VTYPE_FILE:
                                foreach ($this->files as $file) {
                                    if ($file['formname']===$fieldName) {
                                        $fhead = array(self::CONTENT_TYPE => $file['ctype']);
                                        $body .= self::encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
                                    }
                                }
                                break;
                            case self::VTYPE_SCALAR:
                                if (isset($this->paramsPost[$fieldName])) {
                                    if (is_array($this->paramsPost[$fieldName])) {
                                        $flattened = self::_flattenParametersArray($this->paramsPost[$fieldName], $fieldName);
                                        foreach ($flattened as $pp) {
                                            $body .= self::encodeFormData($boundary, $pp[0], $pp[1]);
                                        }
                                    } else {
                                        $body .= self::encodeFormData($boundary, $fieldName, $this->paramsPost[$fieldName]);
                                    }
                                }
                                break;
                        }
                    }

                    $body .= "--{$boundary}--\r\n";
                    break;

                case self::ENC_URLENCODED:
                    // Encode body as application/x-www-form-urlencoded
                    $this->setHeaders(self::CONTENT_TYPE, self::ENC_URLENCODED);
                    $body = http_build_query($this->paramsPost, '', '&');
                    break;

                default:
                    if (isset($mbIntEnc)) {
                        mb_internal_encoding($mbIntEnc);
                    }

                    /** @see Zend_Http_Client_Exception */

                    throw new Zend_Http_Client_Exception("Cannot handle content type '{$this->enctype}' automatically." .
                        " Please use Zend_Http_Client::setRawData to send this kind of content.");
                    break;
            }
        }

        // Set the Content-Length if we have a body or if request is POST/PUT
        if ($body || $this->method == self::POST || $this->method == self::PUT) {
            $this->setHeaders(self::CONTENT_LENGTH, strlen($body));
        }

        if (isset($mbIntEnc)) {
            mb_internal_encoding($mbIntEnc);
        }

        return $body;
    }
536496
public static function create()
    {
        $result = new static();
        $result->devBranches = [];
        $result->directoryToParse = '';
        $result->directoryForPlaces = '';
        $result->detectedVersions = [];
        $result->tagToVersionRegexp = '/^(?:v(?:er(?:s(?:ion)?)?)?[.\s]*)?(\d+(?:\.\d+)*)$/';
        $result->setTagFilters(null);

        return $result;
    }
847643
public function setBody() {
		$this->_swift['message']->setBody($this->message, $this->contentType, $this->charset);
		
		return $this;
	}
1019726
public function ignoredCodes()
    {
        if (is_null($this->ignoredCodeRequests)) {
            $this->ignoredCodeRequests = new IgnoredCodeRequests($this->client);
        }

        return $this->ignoredCodeRequests;
    }
721529
public function createInstanceByCode() {
		$name = $this->getFreeAnonymousName();
	
		$this->declaredInstances[$name]["weak"] = false;
		$this->declaredInstances[$name]["comment"] = "";
		$this->declaredInstances[$name]["class"] = null;
		$this->declaredInstances[$name]["external"] = false;
		$this->declaredInstances[$name]["code"] = "";
		$this->setInstanceAnonymousness($name, true);
	
		return $this->getInstanceDescriptor($name);
	}
413714
public static function create()
    {
        $ob = new stdClass;
        $ob->value = self::DEFAULT_CONTENT_TYPE;

        return new self(null, $ob);
    }
1178999
protected function copy()
    {
        if ($this->isStale) {
            throw new \BadMethodCallException("Unable to modify a stale response object");
        }
        
        $response = clone $this;
        
        if ($this->isStale === false) {
            $this->status = new ResponseStatus($this->status);
            $this->headers = new Headers($this->getHeaders());

            $this->isStale = true;
        }
        
        return $response;
    }
1263831
public function withoutGlobalEnvironment()
    {
        if ($this->isStale === null) {
            return $this;
        }
        
        $response = clone $this;
        
        $response->copy(); // explicitly make stale
        
        if ($response->body instanceof OutputBufferStream) {
            $response->body = $response->body->withLocalScope();
        }
        
        $response->isStale = null;
        
        return $response;
    }
593902
public function create(): self
    {
        $this->payload = null;
        $this->aad = null;
        $this->recipients = [];
        $this->sharedProtectedHeader = [];
        $this->sharedHeader = [];
        $this->compressionMethod = null;
        $this->contentEncryptionAlgorithm = null;
        $this->keyManagementMode = null;

        return $this;
    }