<commit_before><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\SolrBundle\Mapping\Driver;

use Symfony\Component\Finder\Finder;

/**
 * FileLocator for directories where YML files can be found
 *
 * @author <NAME> <<EMAIL>>
 */
class FileLocator
{
    /**
     * @var array
     */
    protected $directories = array();

    /**
     * @param array $directories
     */
    public function __construct($directories = array())
    {
        $this->directories = (array) $directories;
    }

    /**
     * @param $extension
     * @return Finder
     */
    public function getFiles($extension)
    {
        $finder = new Finder();
        if (count($this->directories) > 0) {
            $finder
                ->ignoreUnreadableDirs()
                ->in($this->directories)
                ->name("*.$extension")
            ;
        }

        return $finder;
    }

    /**
     * @param array $directories
     */
    public function setDirectories($directories)
    {
        $this->directories = $directories;
    }

    /**
     * @return array
     */
    public function getDirectories()
    {
        return $this->directories;
    }
}<commit_msg>Added getter and setter for finder<commit_after><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\SolrBundle\Mapping\Driver;

use Symfony\Component\Finder\Finder;

/**
 * FileLocator for directories where YML files can be found
 *
 * @author <NAME> <<EMAIL>>
 */
class FileLocator
{
    /**
     * @var array
     */
    protected $directories = array();

    /**
     * @var Finder
     */
    protected $finder;

    /**
     * @param array $directories
     */
    public function __construct($directories = array())
    {
        $this->directories = (array) $directories;
    }

    /**
     * @param $extension
     * @return Finder
     */
    public function getFiles($extension)
    {
        if (count($this->directories) > 0) {
            $this->getFinder()
                ->ignoreUnreadableDirs()
                ->in($this->directories)
                ->name("*.$extension")
            ;
        }

        return $this->getFinder();
    }

    /**
     * @param array $directories
     * @return $this
     */
    public function setDirectories($directories)
    {
        $this->directories = $directories;
        return $this;
    }

    /**
     * @return array
     */
    public function getDirectories()
    {
        return $this->directories;
    }

    /**
     * @param Finder $finder
     * @return $this
     */
    public function setFinder(Finder $finder)
    {
        $this->finder = $finder;
        return $this;
    }

    /**
     * @return Finder
     */
    public function getFinder()
    {
        if (null === $this->finder) {
            $this->finder = new Finder();
        }
        return $this->finder;
    }
}
{'fraction_non_alphanumeric': 0.13203463203463203, 'fraction_numerical': 0.0006184291898577613, 'mean_word_length': 1.9013452914798206, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 37, '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': '1529818', 'n_tokens_mistral': 963, 'n_tokens_neox': 940, 'n_words': 234}