<commit_before><?php
namespace Metronome\Util;

use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
 * Class TestFile
 * @package Metronome\Util
 */
class TestFile extends UploadedFile
{
    private $pathName;
    private $mime;

    public function __construct($originalName, $mimeType = null, $size = null, $error = null) {
        parent::__construct("/path/to/".$originalName, $originalName, $mimeType, $size, $error ?: "test-file", true);
        $this->pathName = "/path/to/".$originalName;
        $this->mime = $mimeType;
    }

    public function getPathname()
    {
        return $this->pathName;
    }

    public function getMimeType()
    {
        return $this->mime;
    }

    public function move($directory, $name = null)
    {
        return null;
    }

    public function toBrowsable() {
        $file = array();
        $file['relativePathName'] = $this->getClientOriginalName();
        $file['pathName'] = $this->pathName;
        $file['name'] = $this->getFilename();
        return $file;
    }
}<commit_msg>Extended TestFile to have more information about a file.<commit_after><?php
namespace Metronome\Util;

use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
 * Class TestFile
 * @package Metronome\Util
 */
class TestFile extends UploadedFile
{
    private $pathName;
    private $mime;
    private $extension;
    private $baseName;
    private $modifiedDate;

    /**
     * TestFile constructor.
     * @param string $originalName
     * @param string $mimeType
     * @param int $size
     * @param string $error
     * @param string $extension
     * @param string $baseName
     * @param int $modifiedDate
     */
    public function __construct($originalName, $mimeType = null, $size = null, $error = null,
                                $extension = ".ext", $baseName = "testFile", $modifiedDate = 1512076615) {
        parent::__construct("/path/to/".$originalName, $originalName, $mimeType, $size, $error ?: "test-file", true);
        $this->pathName = "/path/to/".$originalName;
        $this->mime = $mimeType;
        $this->extension = $extension;
        $this->baseName = $baseName;
        $this->modifiedDate = $modifiedDate;
    }

    public function getPathname()
    {
        return $this->pathName;
    }

    public function getMimeType()
    {
        return $this->mime;
    }

    public function move($directory, $name = null)
    {
        return null;
    }

    public function toBrowsable() {
        $file = array();
        $file['relativePathName']   = $this->getClientOriginalName();
        $file['pathName']           = $this->pathName;
        $file['name']               = $this->getFilename();
        $file['extension']          = $this->extension;
        $file['baseName']           = $this->baseName;
        $file['modifiedDate']       = $this->modifiedDate;
        $file['size']               = $this->getSize();
        return $file;
    }
}
{'fraction_non_alphanumeric': 0.14227504244482173, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 2.449648711943794, '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': '4530874', 'n_tokens_mistral': 897, 'n_tokens_neox': 866, 'n_words': 191}