BookingControllerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 12 1
1
<?php
2
3
namespace JhFlexiTime\Controller\Factory;
4
5
use JhFlexiTime\Controller\BookingController;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
/**
10
 * Class BookingControllerFactory
11
 * @package JhFlexiTime\Controller\Factory
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class BookingControllerFactory implements FactoryInterface
15
{
16
    /**
17
     * @param ServiceLocatorInterface $serviceLocator
18
     * @return BookingAdminController
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        //get parent locator
23
        $serviceLocator = $serviceLocator->getServiceLocator();
24
25
        return new BookingController(
26
            $serviceLocator->get('JhFlexiTime\Service\BookingService'),
27
            $serviceLocator->get('JhFlexiTime\Service\TimeCalculatorService'),
28
            $serviceLocator->get('FormElementManager')->get('JhFlexiTime\Form\BookingForm'),
29
            $serviceLocator->get('JhFlexiTime\Repository\UserSettingsRepository')
30
        );
31
    }
32
}
33