<commit_before><?php
/**
 * @author <NAME> <EMAIL>
 * @copyright (c) <NAME> 2013
 * @license http://opensource.org/licenses/mit-license.php
 */

namespace StrokerCache\Strategy;

use Zend\Mvc\MvcEvent;
use Zend\Stdlib\AbstractOptions;

class ControllerName extends AbstractOptions implements StrategyInterface
{
    /**
     * @var array
     */
    private $controllers;

    /**
     * True if the request should be cached
     *
     * @param MvcEvent $event
     * @return boolean
     */
    public function shouldCache(MvcEvent $event)
    {
        return in_array($event->getControllerClass(), $this->getControllers());
    }

    /**
     * Cache tags to use for this page
     *
     * @param \Zend\Mvc\MvcEvent $event
     * @return array
     */
    public function getTags(MvcEvent $event)
    {
        return array(
            'strokercache_controller_' . $event->getControllerClass()
        );
    }

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

    /**
     * @param array $controllers
     */
    public function setControllers($controllers)
    {<commit_msg>fixed wrong controller name strategy<commit_after><?php
/**
 * @author <NAME> <EMAIL>
 * @copyright (c) <NAME> 2013
 * @license http://opensource.org/licenses/mit-license.php
 */

namespace StrokerCache\Strategy;

use Zend\Mvc\MvcEvent;
use Zend\Stdlib\AbstractOptions;

class ControllerName extends AbstractOptions implements StrategyInterface
{
    /**
     * @var array
     */
    private $controllers;

    /**
     * True if the request should be cached
     *
     * @param MvcEvent $event
     * @return boolean
     */
    public function shouldCache(MvcEvent $event)
    {
        $routeMatch = $event->getRouteMatch();
        $controller = $routeMatch->getParam('controller');
        return in_array($controller, $this->getControllers());
    }

    /**
     * Cache tags to use for this page
     *
     * @param \Zend\Mvc\MvcEvent $event
     * @return array
     */
    public function getTags(MvcEvent $event)
    {
        return array(
            'strokercache_controller_' . $event->getControllerClass()
        );
    }

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

    /**
     * @param array $controllers
     */
    public function setControllers($controllers)
    {
{'fraction_non_alphanumeric': 0.12046204620462046, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 2.3494475138121547, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 18, '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': '123952', 'n_tokens_mistral': 724, 'n_tokens_neox': 719, 'n_words': 164}