<commit_before><?php

	namespace HippoPHP\Hippo;

	use \HippoPHP\Hippo\CheckContextProvider;
	use \HippoPHP\Hippo\Config\Config;
	use \HippoPHP\Hippo\Exception\FileNotFoundException;
	use \HippoPHP\Hippo\File;

	class CheckRunner {
		/**
		 * @var FileSystem
		 */
		private $_fileSystem;

		/**
		 * @var CheckRepository
		 */
		private $_checkRepository;

		/**
		 * @var Config
		 */
		private $_config;

		/**
		 * @var callable
		 */
		private $_observer;

		/**
		 * @param CheckRepository
		 */
		public function __construct(
			FileSystem $fileSystem,
			CheckRepository $checkRepository,
			Config $config
		) {
			$this->_fileSystem = $fileSystem;
			$this->_checkRepository = $checkRepository;
			$this->_config = $config;
			$this->_observer = null;
		}

		/**
		 * @param callable $observer
		 * @return void
		 */
		public function setObserver(callable $observer) {
			$this->_observer = $observer;
		}

		/**
		 * @param string $path
		 * @return boolean if there were no errors
		 */
		public function checkPath($path) {
			if (!file_exists($path)) {
				throw new FileNotFoundException('File does not exist: ' . $path);
			}

			return is_dir($path)
				? $this->_checkPathDirectory($path)
				: $this->_checkPathFile($path);
		}

		/**
		 * @param File $file
		 * @return CheckResult[]
		 */
		public function checkFile(File $file) {
			$checkContext = new CheckContext($file);
			$results = [];
			foreach ($this->_checkRepository->getChecks() as $check) {
				$branch = $this->_config->get($check->getConfigRoot());<commit_msg>Fixes #27<commit_after><?php

	namespace HippoPHP\Hippo;

	use \HippoPHP\Hippo\CheckContextProvider;
	use \HippoPHP\Hippo\Config\Config;
	use \HippoPHP\Hippo\Exception\FileNotFoundException;
	use \HippoPHP\Hippo\File;

	class CheckRunner {
		/**
		 * @var FileSystem
		 */
		private $_fileSystem;

		/**
		 * @var CheckRepository
		 */
		private $_checkRepository;

		/**
		 * @var Config
		 */
		private $_config;

		/**
		 * @var callable
		 */
		private $_observer;

		/**
		 * @param CheckRepository
		 */
		public function __construct(
			FileSystem $fileSystem,
			CheckRepository $checkRepository,
			Config $config
		) {
			$this->_fileSystem = $fileSystem;
			$this->_checkRepository = $checkRepository;
			$this->_config = $config;
			$this->_observer = null;
		}

		/**
		 * @param callable $observer
		 * @return void
		 */
		public function setObserver(callable $observer) {
			$this->_observer = $observer;
		}

		/**
		 * @param string $path
		 * @return boolean if there were no errors
		 */
		public function checkPath($path) {
			if (!file_exists($path)) {
				throw new FileNotFoundException($path);
			}

			return is_dir($path)
				? $this->_checkPathDirectory($path)
				: $this->_checkPathFile($path);
		}

		/**
		 * @param File $file
		 * @return CheckResult[]
		 */
		public function checkFile(File $file) {
			$checkContext = new CheckContext($file);
			$results = [];
			foreach ($this->_checkRepository->getChecks() as $check) {
				$branch = $this->_config->get($check->getConfigRoot());
{'fraction_non_alphanumeric': 0.1452349869451697, 'fraction_numerical': 0.0006527415143603133, 'mean_word_length': 3.1587516960651287, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '1027682', 'n_tokens_mistral': 1191, 'n_tokens_neox': 959, 'n_words': 204}