BookingOptionsFactory::createService()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace JhFlexiTime\Options\Factory;
4
5
use JhFlexiTime\Options\BookingOptions;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
/**
10
 * Class BookingOptionsFactory
11
 * @package JhFlexiTime\Options\Factory
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class BookingOptionsFactory implements FactoryInterface
15
{
16
    /**
17
     * @param ServiceLocatorInterface $serviceLocator
18
     * @return ModuleOptions
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        $config = $serviceLocator->get('Config');
23
24
        return new BookingOptions(
25
            isset($config['flexi']['booking_options']) ? $config['flexi']['booking_options'] : []
26
        );
27
    }
28
}
29