ServiceLoader   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadServices() 0 15 1
1
<?php
2
3
namespace Gr8abbasi\Container;
4
5
use Mcustiel\Config\ConfigLoader;
6
7
/**
8
 * Class ServiceLoader
9
 *
10
 * Loads configuration from different file types
11
 */
12
class ServiceLoader
13
{
14
    /**
15
     * @var array $services
16
     */
17
    private $services;
18
19
    /**
20
     * Load Services from config files
21
     * using php file config library
22
     *
23
     * @param string $configFilePath
24
     * @param ConfigReader $configReader
25
     * @param CacheConfig $cacheConfig
26
     *
27
     * @return array $services
28
     */
29 4
    public function loadServices(
30
        $configFilePath,
31
        $configReader,
32
        $cacheConfig = null
33
    ) {
34 4
        $loader = new ConfigLoader(
35 4
            $configFilePath,
36 4
            $configReader,
37
            $cacheConfig
38 4
        );
39 4
        $services = $loader->load();
40 4
        $this->services = $services->getFullConfigAsArray();
41
42 4
        return $this->services;
43
    }
44
}
45