PhingServiceFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace BsbPhingService\Service\Factory;
4
5
use BsbPhingService\Options\PhingOptions;
6
use BsbPhingService\Options\ServiceOptions;
7
use BsbPhingService\Service\PhingService;
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
11
class PhingServiceFactory implements FactoryInterface
12
{
13
    /**
14
     * Create service
15
     *
16
     * @param ServiceLocatorInterface $serviceLocator
17
     * @return PhingService
18
     */
19 1
    public function createService(ServiceLocatorInterface $serviceLocator)
20
    {
21
        /** @var ServiceOptions $options */
22 1
        $options = $serviceLocator->get('BsbPhingService.serviceOptions');
23
        /** @var PhingOptions $phingOptions */
24 1
        $phingOptions = $serviceLocator->get('BsbPhingService.phingOptions');
25
26 1
        return new PhingService($options, $phingOptions);
27
    }
28
}
29