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

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