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

ConfigFileServiceFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 19
ccs 0
cts 2
cp 0
rs 9.4285
cc 1
eloc 1
nc 1
nop 1
crap 2
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