Code Duplication    Length = 16-25 lines in 4 locations

module/Jobs/src/Jobs/Factory/Controller/JobboardControllerFactory.php 1 location

@@ 18-42 (lines=25) @@
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
class JobboardControllerFactory implements FactoryInterface
19
{
20
21
    /**
22
     * Injects all needed services into the JobboardController
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return JobboardController
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /** @var ControllerManager $serviceLocator */
31
        $serviceLocator = $serviceLocator->getServiceLocator();
32
33
        $searchForm = $serviceLocator->get('forms')->get('Jobs/ListFilter', /* useAcl */ false);
34
35
        /**
36
         * @var $jobRepository Repository\Job
37
         */
38
        $jobRepository = $serviceLocator->get('repositories')->get('Jobs/Job');
39
40
        return new JobboardController($jobRepository, $searchForm);
41
    }
42
}
43

module/Jobs/src/Jobs/Factory/Controller/TemplateControllerFactory.php 1 location

@@ 18-41 (lines=24) @@
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
class TemplateControllerFactory implements FactoryInterface
19
{
20
21
    /**
22
     * Injects all needed services into the TemplateController
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return TemplateController
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /** @var ControllerManager $serviceLocator */
31
        $serviceLocator = $serviceLocator->getServiceLocator();
32
33
        /**
34
         * @var $jobRepository Repository\Job
35
         */
36
        $jobRepository = $serviceLocator->get('repositories')->get('Jobs/Job');
37
        $options = $serviceLocator->get('Jobs/Options');
38
39
        return new TemplateController($jobRepository, $options);
40
    }
41
}
42

module/Jobs/src/Jobs/Factory/Controller/IndexControllerFactory.php 1 location

@@ 18-42 (lines=25) @@
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
class IndexControllerFactory implements FactoryInterface
19
{
20
21
    /**
22
     * Injects all needed services into the IndexController
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return JobboardController
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /** @var ControllerManager $serviceLocator */
31
        $serviceLocator = $serviceLocator->getServiceLocator();
32
33
        $searchForm = $serviceLocator->get('forms')->get('Jobs/ListFilter', /* useAcl */ true);
34
35
        /**
36
         * @var $jobRepository Repository\Job
37
         */
38
        $jobRepository = $serviceLocator->get('repositories')->get('Jobs/Job');
39
40
        return new IndexController($jobRepository, $searchForm);
41
    }
42
}
43

module/Core/src/Core/Factory/View/Helper/SocialButtonsFactory.php 1 location

@@ 17-32 (lines=16) @@
14
use Zend\ServiceManager\ServiceLocatorInterface;
15
use Core\View\Helper\SocialButtons;
16
17
class SocialButtonsFactory implements FactoryInterface {
18
19
    /**
20
     * @param ServiceLocatorInterface $serviceLocator
21
     *
22
     * @return SocialButtons
23
     */
24
    public function createService(ServiceLocatorInterface $serviceLocator)
25
    {
26
        /* @var $serviceLocator \Zend\View\HelperPluginManager */
27
        $options = $serviceLocator->getServiceLocator()->get('Auth/Options');
28
        $config = $serviceLocator->getServiceLocator()->get('Config');
29
        $helper = new SocialButtons($options,$config);
30
        return $helper;
31
    }
32
}
33
34