<commit_before><?php
/**
 * @license MIT
 * @author <NAME> <<EMAIL>>
 */
namespace Dspbee\Bundle\Common\File;

use Dspbee\Bundle\Common\File\Exception\FileException;
use Dspbee\Bundle\Common\File\Exception\FileNotFoundException;
use Dspbee\Bundle\Common\File\Extension\Extension;
use Dspbee\Bundle\Common\File\MimeType\MimeType;

/**
 * Class File
 * @package Dspbee\Bundle\Common\File
 */
class File extends \SplFileInfo
{
    /**
     * @param string $path      The path to the file
     * @param bool   $checkPath Whether to check the path or not
     *
     * @throws FileNotFoundException If the given path is not a file
     */
    public function __construct($path, $checkPath = true)
    {
        if ($checkPath && !is_file($path)) {
            throw new FileNotFoundException($path);
        }

        parent::__construct($path);
    }

    /**
     * @param string $directory
     * @param string|null $name
     *
     * @return File
     *
     * @throws FileException
     */
    public function move($directory, $name = null)
    {
        $target = $this->getTargetFile($directory, $name);

        if (!@rename($this->getPathname(), $target)) {
            $error = error_get_last();
            throw new FileException(sprintf('Could not rename the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message'])));
        }

        if (false === @chmod($target, 0666 & ~umask())) {
            throw new FileException(sprintf('Unable to change mode of the "%s"', $target));
        }

        return $target;
    }

    /**
     * @return string|null
     */
    public function guessExtension()
    {
        return Extension::getInstance()->guess($this->guessMimeType());
    }

    /**
     * @return string|null
     */
    public function guessMimeType()
    {
        return MimeType::getInstance()->guess($this->getPathname());
    }
<commit_msg>Change exception message<commit_after><?php
/**
 * @license MIT
 * @author <NAME> <<EMAIL>>
 */
namespace Dspbee\Bundle\Common\File;

use Dspbee\Bundle\Common\File\Exception\FileException;
use Dspbee\Bundle\Common\File\Exception\FileNotFoundException;
use Dspbee\Bundle\Common\File\Extension\Extension;
use Dspbee\Bundle\Common\File\MimeType\MimeType;

/**
 * Class File
 * @package Dspbee\Bundle\Common\File
 */
class File extends \SplFileInfo
{
    /**
     * @param string $path      The path to the file
     * @param bool   $checkPath Whether to check the path or not
     *
     * @throws FileNotFoundException If the given path is not a file
     */
    public function __construct($path, $checkPath = true)
    {
        if ($checkPath && !is_file($path)) {
            throw new FileNotFoundException($path);
        }

        parent::__construct($path);
    }

    /**
     * @param string $directory
     * @param string|null $name
     *
     * @return File
     *
     * @throws FileException
     */
    public function move($directory, $name = null)
    {
        $target = $this->getTargetFile($directory, $name);

        if (!@rename($this->getPathname(), $target)) {
            $error = error_get_last();
            throw new FileException(sprintf('Could not rename the file "%s" (%s)', $this->getPathname(), strip_tags($error['message'])));
        }

        if (false === @chmod($target, 0666 & ~umask())) {
            throw new FileException(sprintf('Unable to change mode of the "%s"', $target));
        }

        return $target;
    }

    /**
     * @return string|null
     */
    public function guessExtension()
    {
        return Extension::getInstance()->guess($this->guessMimeType());
    }

    /**
     * @return string|null
     */
    public function guessMimeType()
    {
        return MimeType::getInstance()->guess($this->getPathname());
    }

{'fraction_non_alphanumeric': 0.1437994722955145, 'fraction_numerical': 0.0021108179419525065, 'mean_word_length': 2.5764150943396227, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '6321644', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1115, 'n_words': 263}