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

RequireEnvFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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