<commit_before><?php
namespace Tuum\Respond\Helper;

use Psr\Http\Message\ResponseInterface;

class ResponseHelper
{
    /**
     * Is this response successful?
     *
     * @param ResponseInterface $response
     * @return bool
     */
    public static function isOk($response)
    {
        return $response->getStatusCode() === 200;
    }

    /**
     * @param ResponseInterface $response
     * @return bool
     */
    public static function isRedirect($response)
    {<commit_msg>add another new way to create a response object.<commit_after><?php
namespace Tuum\Respond\Helper;

use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Response;

class ResponseHelper
{
    public static function create($status = 200, $body = null, $header = [])
    {
        $response = new Response('php://memory', $status, $header);
        if ($body) {
            $response->getBody()->write($body);
        }
        
        return $response;
    }
    
    /**
     * Is this response successful?
     *
     * @param ResponseInterface $response
     * @return bool
     */
    public static function isOk($response)
    {
        return $response->getStatusCode() === 200;
    }

    /**
     * @param ResponseInterface $response
     * @return bool
     */
    public static function isRedirect($response)
    {
{'fraction_non_alphanumeric': 0.11987860394537178, 'fraction_numerical': 0.006828528072837633, 'mean_word_length': 2.425974025974026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7222980', 'n_tokens_mistral': 375, 'n_tokens_neox': 363, 'n_words': 92}