<commit_before><?php
/*
 *
 *
 * @copyright Copyright (c) 2014-2014 KipsProduction (http://www.kips.gr.jp)
 * @license   http://www.kips.gr.jp/newbsd/LICENSE.txt New BSD License
 */

namespace NpPage;

use Zend\EventManager\ListenerAggregateInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Mvc\MvcEvent;

/**
 * 本Subscriberは、ServiceInterfaceへの依存ではなく、
 * Serviceクラスそのものへの依存である。
 * 　Serviceクラスの(ほぼ)内部クラスという位置づけとなる。
 *
 * @author tomoaki
 */
class ServiceSubscriber implements ListenerAggregateInterface {

    /**
     * @var \Zend\Stdlib\CallbackHandler[]
     */
    protected $listeners = array();

    /**
     *
     * @var \NpPage\Service
     */
    protected $service;

    protected $sharedEventAttached;

    public function __construct(Service $service)
    {
        $this->service = $service;
    }

    /**
     * Attach to an event manager
     *
     * @param  EventManagerInterface $events
     * @param  integer $priority
     */
    public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this->service, 'onRoute'), $priority);
        /**
         *
         * @see \Zend\Mvc\View\Http\ExceptionStrategy
         *         $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'prepareExceptionViewModel'));
         *         $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, array($this, 'prepareExceptionViewModel'));
         *
         * ExceptionStrategyは例外処理に関して、例外処理用のテンプレートを使って、<commit_msg>Update ServiceSubscriber reduce onRoute priority<commit_after><?php
/*
 *
 *
 * @copyright Copyright (c) 2014-2014 KipsProduction (http://www.kips.gr.jp)
 * @license   http://www.kips.gr.jp/newbsd/LICENSE.txt New BSD License
 */

namespace NpPage;

use Zend\EventManager\ListenerAggregateInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Mvc\MvcEvent;

/**
 * 本Subscriberは、ServiceInterfaceへの依存ではなく、
 * Serviceクラスそのものへの依存である。
 * 　Serviceクラスの(ほぼ)内部クラスという位置づけとなる。
 *
 * @author tomoaki
 */
class ServiceSubscriber implements ListenerAggregateInterface {

    /**
     * @var \Zend\Stdlib\CallbackHandler[]
     */
    protected $listeners = array();

    /**
     *
     * @var \NpPage\Service
     */
    protected $service;

    protected $sharedEventAttached;

    public function __construct(Service $service)
    {
        $this->service = $service;
    }

    /**
     * Attach to an event manager
     *
     * @param  EventManagerInterface $events
     * @param  integer $priority
     */
    public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this->service, 'onRoute'), -100);
        /**
         *
         * @see \Zend\Mvc\View\Http\ExceptionStrategy
         *         $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'prepareExceptionViewModel'));
         *         $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, array($this, 'prepareExceptionViewModel'));
         *
         * ExceptionStrategyは例外処理に関して、例外処理用のテンプレートを使って、
{'fraction_non_alphanumeric': 0.13169502205419029, 'fraction_numerical': 0.006616257088846881, 'mean_word_length': 3.1233766233766236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6793468', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1053, 'n_words': 161}