Completed
Pull Request — master (#392)
by Christian
03:03
created

ControllerPath::onGetControllerPathShippingGroups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
/**
3
 * (c) shopware AG <[email protected]>
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace ShopwarePlugins\Connect\Subscribers;
9
10
use Enlight\Event\SubscriberInterface;
11
12
class ControllerPath implements SubscriberInterface
13
{
14
    /**
15
     * @var string
16
     */
17
    private $pluginPath;
18
19
    /**
20
     * @param string $pluginPath
21
     */
22
    public function __construct($pluginPath)
23
    {
24
        $this->pluginPath = $pluginPath;
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    public static function getSubscribedEvents()
31
    {
32
        return [
33
            'Enlight_Controller_Dispatcher_ControllerPath_Backend_ConnectGateway' => 'onGetControllerPathGateway',
34
            'Enlight_Controller_Dispatcher_ControllerPath_Frontend_Connect' => 'onGetControllerPathFrontend',
35
            'Enlight_Controller_Dispatcher_ControllerPath_Frontend_ConnectProductGateway' => 'onGetControllerPathFrontendConnectControllerGateway',
36
            'Enlight_Controller_Dispatcher_ControllerPath_Backend_Connect' => 'onGetControllerPathBackend',
37
            'Enlight_Controller_Dispatcher_ControllerPath_Backend_LastChanges' => 'onGetLastChangesControllerPath',
38
            'Enlight_Controller_Dispatcher_ControllerPath_Backend_ConnectConfig' => 'onGetControllerPathConnectConfig',
39
            'Enlight_Controller_Dispatcher_ControllerPath_Backend_Import' => 'onGetControllerPathImport'
40
        ];
41
    }
42
43
    /**
44
     * Register the connect backend controller
45
     *
46
     * @param   \Enlight_Event_EventArgs $args
47
     * @return  string
48
     * @Enlight\Event Enlight_Controller_Dispatcher_ControllerPath_Backend_Connect
49
     */
50
    public function onGetControllerPathBackend(\Enlight_Event_EventArgs $args)
51
    {
52
        return $this->pluginPath . 'Controllers/Backend/Connect.php';
53
    }
54
55
    /**
56
     * Register the connect backend controller
57
     *
58
     * @param   \Enlight_Event_EventArgs $args
59
     * @return  string
60
     * @Enlight\Event Enlight_Controller_Dispatcher_ControllerPath_Backend_Connect
61
     */
62
    public function onGetLastChangesControllerPath(\Enlight_Event_EventArgs $args)
63
    {
64
        return $this->pluginPath . 'Controllers/Backend/LastChanges.php';
65
    }
66
67
    /**
68
     * Register the connectGateway backend controller
69
     *
70
     * @param   \Enlight_Event_EventArgs $args
71
     * @return  string
72
     */
73
    public function onGetControllerPathGateway(\Enlight_Event_EventArgs $args)
74
    {
75
        return $this->pluginPath . '/Controllers/Backend/ConnectGateway.php';
76
    }
77
78
    /**
79
     * Register the connect frontend controller
80
     *
81
     * @param   \Enlight_Event_EventArgs $args
82
     * @return  string
83
     */
84
    public function onGetControllerPathFrontend(\Enlight_Event_EventArgs $args)
85
    {
86
        return $this->pluginPath . 'Controllers/Frontend/Connect.php';
87
    }
88
89
    /**
90
     * Register the connect product frontend controller
91
     *
92
     * @param   \Enlight_Event_EventArgs $args
93
     * @return  string
94
     */
95
    public function onGetControllerPathFrontendConnectControllerGateway(\Enlight_Event_EventArgs $args)
96
    {
97
        return $this->pluginPath . 'Controllers/Frontend/ConnectProductGateway.php';
98
    }
99
100
    /**
101
     * Register the connect config backend controller
102
     *
103
     * @param   \Enlight_Event_EventArgs $args
104
     * @return  string
105
     * @Enlight\Event Enlight_Controller_Dispatcher_ControllerPath_Backend_ConnectConfig
106
     */
107
    public function onGetControllerPathConnectConfig(\Enlight_Event_EventArgs $args)
108
    {
109
        return $this->pluginPath . 'Controllers/Backend/ConnectConfig.php';
110
    }
111
112
    /**
113
     * Register the connect import backend controller
114
     *
115
     * @param   \Enlight_Event_EventArgs $args
116
     * @return  string
117
     * @Enlight\Event Enlight_Controller_Dispatcher_ControllerPath_Backend_Import
118
     */
119
    public function onGetControllerPathImport(\Enlight_Event_EventArgs $args)
120
    {
121
        return $this->pluginPath . 'Controllers/Backend/Import.php';
122
    }
123
}
124