Completed
Pull Request — master (#11)
by Timothy
03:13
created

RequireEnvFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 6 1
1
<?php
2
3
namespace Abacaphiliac\ZendPhpDotEnv\Diagnostics;
4
5
use Abacaphiliac\ZendPhpDotEnv\Options\ModuleOptionsFactory;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
class RequireEnvFactory implements FactoryInterface
10
{
11
    /**
12
     * Create service
13
     *
14
     * @param ServiceLocatorInterface $serviceLocator
15
     * @return RequireReadableFile
16
     * @throws \InvalidArgumentException
17
     * @throws \Zend\Stdlib\Exception\InvalidArgumentException
18
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        $files = ModuleOptionsFactory::getFiles($serviceLocator);
23
24
        return new RequireReadableFile($files);
25
    }
26
}
27