<commit_before><?php

/**
 * This file is part of slick/http
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Slick\Http\Message\Server;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
use Slick\Http\Message\Exception\InvalidArgumentException;
use Slick\Http\Message\Request as HttpRequest;
use Slick\Http\Message\Stream\TextStream;
use Slick\Http\Message\Uri;

/**
 * Request
 *
 * @package Slick\Http\Message\Server
*/
class Request extends HttpRequest implements ServerRequestInterface
{

    /**
     * @var array
     */
    private $server;

    /**
     * @var array
     */
    private $cookies;

    /**
     * @var array
     */
    private $queryParams;

    /**
     * @var UploadedFile[]
     */
    private $uploadedFiles;

    /**
     * @var mixed
     */
    private $parsedBody;

    /**
     * @var array
     */
    private $attributes = [];

    /**
     * Creates an HTTP Server Request Message
     *
     * @param string                   $method
     * @param string|StreamInterface   $body
     * @param null|string|UriInterface $target
     * @param array                    $headers
     */
    public function __construct($method = null, $target = null, $body = '', array $headers = [])
    {
        $method = null === $method
            ? $this->getServerParams()['REQUEST_METHOD']
            : $method;

        $body = null === $body
            ? $this->getPhpInputStream()
            : $body;
<commit_msg>Fixed bug on server request body creation<commit_after><?php

/**
 * This file is part of slick/http
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Slick\Http\Message\Server;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
use Slick\Http\Message\Exception\InvalidArgumentException;
use Slick\Http\Message\Request as HttpRequest;
use Slick\Http\Message\Stream\TextStream;
use Slick\Http\Message\Uri;

/**
 * Request
 *
 * @package Slick\Http\Message\Server
*/
class Request extends HttpRequest implements ServerRequestInterface
{

    /**
     * @var array
     */
    private $server;

    /**
     * @var array
     */
    private $cookies;

    /**
     * @var array
     */
    private $queryParams;

    /**
     * @var UploadedFile[]
     */
    private $uploadedFiles;

    /**
     * @var mixed
     */
    private $parsedBody;

    /**
     * @var array
     */
    private $attributes = [];

    /**
     * Creates an HTTP Server Request Message
     *
     * @param string                   $method
     * @param string|StreamInterface   $body
     * @param null|string|UriInterface $target
     * @param array                    $headers
     */
    public function __construct($method = null, $target = null, $body = null, array $headers = [])
    {
        $method = null === $method
            ? $this->getServerParams()['REQUEST_METHOD']
            : $method;

        $body = null === $body
            ? $this->getPhpInputStream()
            : $body;

{'fraction_non_alphanumeric': 0.12061538461538461, 'fraction_numerical': 0.0, 'mean_word_length': 2.2412761714855436, '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': '2951176', 'n_tokens_mistral': 938, 'n_tokens_neox': 917, 'n_words': 235}