<commit_before><?php
/**
 * ZF2 Sphinx Search
 *
 * @link        https://github.com/ripaclub/zf2-sphinxsearch
 * @copyright   Copyright (c) 2014, <NAME> <leodidonato at gmail dot com>, <NAME> <me at leonardograsso dot com>
 * @license     http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
 */

namespace SphinxSearchTests;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceManager;

/**
 * Class AbstractTestCase
 * @package SphinxSearchTests
 */
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ServiceLocatorInterface
     */
    protected $serviceLocator = null;

    /**
     * Set service locator
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return mixed
     */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;

        return $this;
    }

    /**
     * Get service locator
     *
     * @return ServiceManager
     */
    public function getServiceLocator()
    {
        return $this->serviceLocator;
    }

    public function setUp()
    {
        $this->setServiceLocator(Bootstrap::getServiceManager());
    }

    /**
     * @return array|object
     */
    public function getConfig()
    {
        return $this->getServiceLocator()->get('Config');
    }

    /**
     * @param int $index
     * @return null|array
     */
    public function getDriverConfig($index = 0)
    {

        $driver = null;
        $counter = 0;
        foreach ($this->getConfig()['sphinxql']['adapters'] as $alias => $driver) {
            if ($index == $counter) {
                return array(
                    'alias'     =>  $alias,
                    'driver'    =>  $driver
                );
            }
            ++$counter;
        }

        return null;
    }

} <commit_msg>php 5.3 support<commit_after><?php
/**
 * ZF2 Sphinx Search
 *
 * @link        https://github.com/ripaclub/zf2-sphinxsearch
 * @copyright   Copyright (c) 2014, <NAME> <leodidonato at gmail dot com>, <NAME> <me at leonardograsso dot com>
 * @license     http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
 */

namespace SphinxSearchTests;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceManager;

/**
 * Class AbstractTestCase
 * @package SphinxSearchTests
 */
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ServiceLocatorInterface
     */
    protected $serviceLocator = null;

    /**
     * Set service locator
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return mixed
     */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;

        return $this;
    }

    /**
     * Get service locator
     *
     * @return ServiceManager
     */
    public function getServiceLocator()
    {
        return $this->serviceLocator;
    }

    public function setUp()
    {
        $this->setServiceLocator(Bootstrap::getServiceManager());
    }

    /**
     * @return array|object
     */
    public function getConfig()
    {
        return $this->getServiceLocator()->get('Config');
    }

    /**
     * @param int $index
     * @return null|array
     */
    public function getDriverConfig($index = 0)
    {

        $driver = null;
        $counter = 0;
        $config = $this->getConfig();
        foreach ($config['sphinxql']['adapters'] as $alias => $driver) {
            if ($index == $counter) {
                return array(
                    'alias'     =>  $alias,
                    'driver'    =>  $driver
                );
            }
            ++$counter;
        }

        return null;
    }

} 
{'fraction_non_alphanumeric': 0.11760184473481937, 'fraction_numerical': 0.005124263387138099, 'mean_word_length': 2.1714053614947195, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '7311056', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1126, 'n_words': 236}