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

Countries::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 5
dl 0
loc 9
ccs 0
cts 3
cp 0
crap 2
rs 9.9666
c 0
b 0
f 0
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