Completed
Pull Request — master (#1663)
by chihiro
20:50
created

Event::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
25
namespace Ext;
26
27
use Eccube\Application;
28
use Eccube\Entity\PluginEventHandler;
29
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
30
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
31
32
class Event implements EventSubscriberInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
33
{
34
    /** @var \Eccube\Application */
35
    protected $app;
36
37
    /**
38
     * Event constructor.
39
     *
40
     * @param Application $app
41
     */
42
    public function __construct(Application $app)
43
    {
44
        $this->app = $app;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public static function getSubscribedEvents()
51
    {
52
        return array(
0 ignored issues
show
introduced by
Add a comma after each item in a multi-line array
Loading history...
53
            // フックポイントの定義サンプル.
54
            //'eccube.event.front.controller' => array('example', PluginEventHandler::EVENT_PRIORITY_NORMAL_START)
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
55
        );
56
    }
57
58
    /**
59
     * フックポイントの定義サンプル.
60
     *
61
     * @param FilterControllerEvent $event
62
     */
63
    public function example(FilterControllerEvent $event)
64
    {
65
        echo($event->getName());
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\EventDispatcher\Event::getName() has been deprecated with message: since version 2.4, to be removed in 3.0. The event name is passed to the listener call.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
66
    }
67
}