<commit_before><?php
namespace Neos\Flow\Mvc;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Helper\ResponseInformationHelper;
use Neos\Flow\Http\Response;
use Psr\Http\Message\UriInterface;

/**
 * The new minimal MVC response object.
 * For anything more use a custom HTTP component and set a component parameter.
 *
 * @Flow\Proxy(false)
 * @api
 */
final class ActionResponse extends \Neos\Flow\Http\Response implements ActionResponseInterface
{
    /**
     * @var array
     */
    private $componentParameters = [];

    /**
     * @var UriInterface
     */
    private $redirectUri;

    /**
     * @var string
     */
    private $contentType = '';

    /**
     * @param string $content
     * @return void
     * @api
     */
    public function setContent($content): void
    {
        $this->content = $content;
    }

    /**
     * Set content mime type for this response.
     *
     * @param string $contentType
     * @return void
     * @api
     */
    public function setContentType(string $contentType): void
    {
        $this->contentType = $contentType;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Content-Type', $contentType);
    }

    /**
     * Set a redirect URI and according status for this response.
     *
     * @param UriInterface $uri
     * @param int $statusCode
     * return void
     * @api
     */
    public function setRedirectUri(UriInterface $uri, int $statusCode = 303): void
    {
        $this->redirectUri = $uri;
        $this->statusCode = $statusCode;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Location', (string)$uri);
        $this->setStatusCode($statusCode);
    }

    /**
     * Set the status code for this response as HTTP status code.
     * Other codes than HTTP status may end in unpredictable results.
     *
     * @param int $statusCode
     * @return void
     * @api
     */
    public function setStatusCode(int $statusCode): void
    {
        $this->statusCode = $statusCode;
        // TODO: This can be removed after the full changes are done for next major.
        $this->setStatusCode($statusCode);
    }<commit_msg>Fix recursion issue with status code<commit_after><?php
namespace Neos\Flow\Mvc;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Helper\ResponseInformationHelper;
use Neos\Flow\Http\Response;
use Psr\Http\Message\UriInterface;

/**
 * The new minimal MVC response object.
 * For anything more use a custom HTTP component and set a component parameter.
 *
 * @Flow\Proxy(false)
 * @api
 */
final class ActionResponse extends \Neos\Flow\Http\Response implements ActionResponseInterface
{
    /**
     * @var array
     */
    private $componentParameters = [];

    /**
     * @var UriInterface
     */
    private $redirectUri;

    /**
     * @var string
     */
    private $contentType = '';

    /**
     * @param string $content
     * @return void
     * @api
     */
    public function setContent($content): void
    {
        $this->content = $content;
    }

    /**
     * Set content mime type for this response.
     *
     * @param string $contentType
     * @return void
     * @api
     */
    public function setContentType(string $contentType): void
    {
        $this->contentType = $contentType;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Content-Type', $contentType);
    }

    /**
     * Set a redirect URI and according status for this response.
     *
     * @param UriInterface $uri
     * @param int $statusCode
     * return void
     * @api
     */
    public function setRedirectUri(UriInterface $uri, int $statusCode = 303): void
    {
        $this->redirectUri = $uri;
        $this->statusCode = $statusCode;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Location', (string)$uri);
        $this->setStatusCode($statusCode);
    }

    /**
     * Set the status code for this response as HTTP status code.
     * Other codes than HTTP status may end in unpredictable results.
     *
     * @param int $statusCode
     * @return void
     * @api
     */
    public function setStatusCode(int $statusCode): void
    {
        $this->statusCode = $statusCode;
    }
{'fraction_non_alphanumeric': 0.1114656940961933, 'fraction_numerical': 0.0013676772281741509, 'mean_word_length': 2.3343465045592704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1445066', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1225, 'n_words': 386}