Completed
Push — master ( 944c9c...280a9a )
by Antonio Carlos
03:20 queued 10s
created

Countries   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 52
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A __call() 0 4 1
A __callStatic() 0 4 1
1
<?php
2
3
namespace PragmaRX\Countries\Package;
4
5
use PragmaRX\Countries\Package\Data\Repository;
6
use PragmaRX\Countries\Package\Services\Helper;
7
use PragmaRX\Countries\Package\Services\Hydrator;
8
use PragmaRX\Countries\Package\Services\Cache\Service as Cache;
9
use PragmaRX\Countries\Package\Services\Countries as CountriesService;
10
11
class Countries
12
{
13
    /**
14
     * The actual Countries class is a service.
15
     *
16
     * @var CountriesService
17
     */
18
    private $countriesService;
19
20
    /**
21
     * Service constructor.
22
     *
23
     * @param $config
24
     * @param Cache $cache
25
     * @param Helper $helper
26
     * @param Hydrator $hydrator
27
     * @param Repository $repository
28
     */
29
    public function __construct(
30
        $config = null,
31
        Cache $cache = null,
32
        Helper $helper = null,
33
        Hydrator $hydrator = null,
34
        Repository $repository = null
35
    ) {
36
        $this->countriesService = new CountriesService($config, $cache, $helper, $hydrator, $repository);
37
    }
38
39
    /**
40
     * Call a method.
41
     *
42
     * @param $name
43
     * @param array $arguments
44
     * @return bool|mixed
45
     */
46
    public function __call($name, array $arguments = [])
47
    {
48
        return \call_user_func_array([$this->countriesService, $name], $arguments);
49
    }
50
51
    /**
52
     * Translate static methods calls to dynamic.
53
     *
54
     * @param $name
55
     * @param array $arguments
56
     * @return mixed
57
     */
58
    public static function __callStatic($name, array $arguments = [])
59
    {
60
        return \call_user_func_array([new static(), $name], $arguments);
61
    }
62
}
63