Completed
Push — master ( 56fc22...f11276 )
by Thomas Mauro
06:14 queued 04:10
created

ConfigurationOptionsFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createService() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
namespace Facile\SentryModule\Service;
4
5
use Facile\SentryModule\Options\ConfigurationOptions;
6
use Interop\Container\ContainerInterface;
7
use Interop\Container\Exception\ContainerException;
8
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
9
use Zend\ServiceManager\Exception\ServiceNotFoundException;
10
use Zend\ServiceManager\FactoryInterface;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
13
/**
14
 * Class ConfigurationOptionsFactory.
15
 */
16
class ConfigurationOptionsFactory implements FactoryInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
17
{
18
    /**
19
     * Create service.
20
     *
21
     * @param ServiceLocatorInterface $serviceLocator
22
     *
23
     * @return ConfigurationOptions
24
     */
25
    public function createService(ServiceLocatorInterface $serviceLocator)
26
    {
27
        return $this($serviceLocator, ConfigurationOptions::class);
28
    }
29
30
    /**
31
     * Create an object.
32
     *
33
     * @param ContainerInterface $container
34
     * @param string             $requestedName
35
     * @param null|array         $options
36
     *
37
     * @return ConfigurationOptions
38
     *
39
     * @throws ServiceNotFoundException   if unable to resolve the service.
40
     * @throws ServiceNotCreatedException if an exception is raised when
41
     *                                    creating a service.
42
     * @throws ContainerException         if any other error occurs
43
     */
44
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
45
    {
46
        return new ConfigurationOptions($container->get('config')['facile']['sentry']['configuration']);
47
    }
48
}
49