<commit_before><?php
/**
 * Slim Framework Doctrine middleware (https://github.com/juliangut/slim-doctrine-middleware)
 *
 * @link https://github.com/juliangut/slim-doctrine-middleware for the canonical source repository
 * @license https://raw.githubusercontent.com/juliangut/slim-doctrine-middleware/master/LICENSE
 */

namespace Jgut\Slim\Middleware;

class DoctrineCacheFactory
{
    /**
     * @param array $cacheDriver
     *
     * @return \Doctrine\Common\Cache\CacheProvider
     */
    public static function configureCache($cacheDriver)
    {
        $cache = null;

        switch (strtolower($cacheDriver['type'])) {
            case 'apc':
                $cache = new \Doctrine\Common\Cache\ApcCache();
                break;

            case 'xcache':
                $cache = new \Doctrine\Common\Cache\XcacheCache();
                break;

            case 'memcache':
                $cache = self::configureMemcacheCache($cacheDriver['host'], $cacheDriver['port']);
                break;
<commit_msg>document interface instead of abstract<commit_after><?php
/**
 * Slim Framework Doctrine middleware (https://github.com/juliangut/slim-doctrine-middleware)
 *
 * @link https://github.com/juliangut/slim-doctrine-middleware for the canonical source repository
 * @license https://raw.githubusercontent.com/juliangut/slim-doctrine-middleware/master/LICENSE
 */

namespace Jgut\Slim\Middleware;

class DoctrineCacheFactory
{
    /**
     * @param array $cacheDriver
     *
     * @return \Doctrine\Common\Cache\Cache
     */
    public static function configureCache($cacheDriver)
    {
        $cache = null;

        switch (strtolower($cacheDriver['type'])) {
            case 'apc':
                $cache = new \Doctrine\Common\Cache\ApcCache();
                break;

            case 'xcache':
                $cache = new \Doctrine\Common\Cache\XcacheCache();
                break;

            case 'memcache':
                $cache = self::configureMemcacheCache($cacheDriver['host'], $cacheDriver['port']);
                break;

{'fraction_non_alphanumeric': 0.12506059137178865, 'fraction_numerical': 0.0, 'mean_word_length': 2.4115702479338843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '1755442', 'n_tokens_mistral': 596, 'n_tokens_neox': 577, 'n_words': 104}