Code Duplication    Length = 10-12 lines in 3 locations

module/Applications/src/Applications/Controller/ApplyController.php 1 location

@@ 47-56 (lines=10) @@
44
    
45
    protected $container;
46
    
47
    public function attachDefaultListeners()
48
    {
49
        parent::attachDefaultListeners();
50
        $events = $this->getEventManager();
51
        $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
52
        $serviceLocator  = $this->getServiceLocator();
53
        $defaultServices = $serviceLocator->get('DefaultListeners');
54
        $events->attach($defaultServices);
55
        return $this;
56
    }
57
    
58
    public function preDispatch(MvcEvent $e)
59
    {

module/Core/src/Core/Controller/FileController.php 1 location

@@ 22-31 (lines=10) @@
19
20
class FileController extends AbstractActionController
21
{
22
    protected function attachDefaultListeners()
23
    {
24
        parent::attachDefaultListeners();
25
        $events = $this->getEventManager();
26
        $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
27
28
        $serviceLocator  = $this->getServiceLocator();
29
        $defaultServices = $serviceLocator->get('DefaultListeners');
30
        $events->attach($defaultServices);
31
    }
32
33
    public function preDispatch(MvcEvent $e)
34
    {

module/Jobs/src/Jobs/Controller/ManageController.php 1 location

@@ 69-80 (lines=12) @@
66
    /**
67
     * @return $this|void
68
     */
69
    public function attachDefaultListeners()
70
    {
71
        parent::attachDefaultListeners();
72
        $events = $this->getEventManager();
73
        $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
74
        $serviceLocator = $this->getServiceLocator();
75
        $defaultServices = $serviceLocator->get('DefaultListeners');
76
        $events = $this->getEventManager();
77
        $events->attach($defaultServices);
78
79
        return $this;
80
    }
81
82
    /**
83
     * Dispatch listener callback.