<commit_before><?php namespace Laracasts\TestDummy;

use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class FixturesFinder {

	/**
	 * The base directory for the search
	 *
	 * @var string
	 */
	static $basePath;

	/**
	 * Track down the fixtures.yml file
	 */
	function __construct($basePath = null)
	{
		static::$basePath = $basePath ?: app_path('tests');
	}

	/**
	 * Track down the fixtures file for TestDummy
	 *
	 * @throws TestDummyException
	 * @return mixed
	 */
	public function find()
	{
		$testsDirectory = new RecursiveIteratorIterator(
			new RecursiveDirectoryIterator(static::$basePath)
		);

		// We'll try to hunt down the fixtures.yaml file.
		// This way, the file can be placed just about anywhere.
		foreach($testsDirectory as $file)
		{
			$name = $file->getFilename();

			if ($name == 'fixtures.yml' or $name == 'fixtures.yaml')
			{
				return $file->getPathname();
			}
		}

		throw new TestDummyException('Could not locate the fixtures.yml file.');
	}
}<commit_msg>No need to set default basepath.<commit_after><?php namespace Laracasts\TestDummy;

use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class FixturesFinder {

	/**
	 * The base directory for the search
	 *
	 * @var string
	 */
	protected $basePath;

	/**
	 * Track down the fixtures.yml file
	 */
	function __construct($basePath)
	{
		$this->basePath = $basePath;
	}

	/**
	 * Track down the fixtures file for TestDummy
	 *
	 * @throws TestDummyException
	 * @return mixed
	 */
	public function find()
	{
		$testsDirectory = new RecursiveIteratorIterator(
			new RecursiveDirectoryIterator($this->basePath)
		);

		// We'll try to hunt down the fixtures.yaml file.
		// This way, the file can be placed just about anywhere.
		foreach($testsDirectory as $file)
		{
			$name = $file->getFilename();

			if ($name == 'fixtures.yml' or $name == 'fixtures.yaml')
			{
				return $file->getPathname();
			}
		}

		throw new TestDummyException('Could not locate the fixtures.yml file.');
	}
}
{'fraction_non_alphanumeric': 0.12063808574277168, 'fraction_numerical': 0.0, 'mean_word_length': 3.530474040632054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3214144', 'n_tokens_mistral': 705, 'n_tokens_neox': 617, 'n_words': 179}