<commit_before><?php namespace Modulework\Modules\File;
/*
 * (c) <NAME> <<EMAIL>>
 * This file is part of the Modulework Framework
 * License: View distributed LICENSE file
 */

use Modulework\Modules\File\Exceptions\FileNotFoundException;

/**
* File
* This class represents a file.
*/
class File
{
	protected $path;

	protected $filesystem;

	public static function open($path, $verify = true, FileSystemInterface $filesystem = null)
	{
		return new static($path, $verify, $filesystem);
	}

	public static function load($path, $verify = false, FileSystemInterface $filesystem = null)
	{
		return new static($path, $verify, $filesystem);
	}

	public function __construct($path, $verify = false, FileSystemInterface $filesystem = null)
	{
		$this->setFilesystem($filesystem);
		if ($verify && !$this->filesystem->exists($path)) {
			throw new FileNotFoundException('File not found at "' . $path . '".');
		}

		$this->path = (string) $path;
	}

	public function __toString()
	{
		return $this->path;
	}

	public function setFileSystem(FileSystemInterface $filesystem = null)
	{
		if ($filesystem === null) {
			$this->filesystem = new Filesystem;
		} else {
			$this->filesystem = $filesystem;
		}
	}

	public function getFileSystem()
	{
		return $this->filesystem;
	}

	public function create()
	{
		return $this->filesystem->create($this->path);
	}<commit_msg>Fixed File (Filesystem -> FileSystem)<commit_after><?php namespace Modulework\Modules\File;
/*
 * (c) <NAME> <<EMAIL>>
 * This file is part of the Modulework Framework
 * License: View distributed LICENSE file
 */

use Modulework\Modules\File\Exceptions\FileNotFoundException;

/**
* File
* This class represents a file.
*/
class File
{
	protected $path;

	protected $filesystem;

	public static function open($path, $verify = true, FileSystemInterface $filesystem = null)
	{
		return new static($path, $verify, $filesystem);
	}

	public static function load($path, $verify = false, FileSystemInterface $filesystem = null)
	{
		return new static($path, $verify, $filesystem);
	}

	public function __construct($path, $verify = false, FileSystemInterface $filesystem = null)
	{
		$this->setFilesystem($filesystem);
		if ($verify && !$this->filesystem->exists($path)) {
			throw new FileNotFoundException('File not found at "' . $path . '".');
		}

		$this->path = (string) $path;
	}

	public function __toString()
	{
		return $this->path;
	}

	public function setFileSystem(FileSystemInterface $filesystem = null)
	{
		if ($filesystem === null) {
			$this->filesystem = new FileSystem;
		} else {
			$this->filesystem = $filesystem;
		}
	}

	public function getFileSystem()
	{
		return $this->filesystem;
	}

	public function create()
	{
		return $this->filesystem->create($this->path);
	}
{'fraction_non_alphanumeric': 0.14181818181818182, 'fraction_numerical': 0.0, 'mean_word_length': 4.373046875, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 32, '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': '1868092', 'n_tokens_mistral': 907, 'n_tokens_neox': 856, 'n_words': 227}