Completed
Push — master ( e1f08c...557060 )
by Muhammad Kashif
24:26
created

ConfigFileServiceFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 25
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 19 1
1
<?php
2
3
namespace Gr8abbasi\Container\Factory;
4
5
use Gr8abbasi\Container\Factory\ServiceFactoryInterface;
6
7
/**
8
 * ConfigFileServiceFactory
9
 */
10
class ConfigFileServiceFactory implements ServiceFactoryInterface
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function create(array $service)
16
    {
17
        // var_dump($service['foo']);exit;
18
        // $name = 'foo';
19
        // if (!isset($service[$name]) || empty($service[$name])) {
20
        //     throw new ContainerException(
21
        //         'Service should be an array with key value pair: ' . $name
22
        //     );
23
        // }
24
        //
25
        // if (!class_exists($service[$name]['class'])) {
26
        //     throw new ContainerException(
27
        //         'Class does not exists: ' . $service[$name]['class']
28
        //     );
29
        // }
30
        //
31
        // $class = new \ReflectionClass($service[$name]['class']);
32
        // return $class->newInstance();
33
    }
34
}
35