AbstractService::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Yproximite\Api\Service;
5
6
use Yproximite\Api\Client\Client;
7
use Yproximite\Api\Factory\ModelFactory;
8
9
/**
10
 * Class AbstractService
11
 */
12
abstract class AbstractService
13
{
14
    /**
15
     * @var Client
16
     */
17
    private $client;
18
19
    /**
20
     * @var ModelFactory
21
     */
22
    private $modelFactory;
23
24
    /**
25
     * AbstractService constructor.
26
     *
27
     * @param Client       $client
28
     * @param ModelFactory $modelFactory
29
     */
30
    public function __construct(Client $client, ModelFactory $modelFactory)
31
    {
32
        $this->client       = $client;
33
        $this->modelFactory = $modelFactory;
34
    }
35
36
    /**
37
     * @return Client
38
     */
39
    protected function getClient(): Client
40
    {
41
        return $this->client;
42
    }
43
44
    /**
45
     * @return ModelFactory
46
     */
47
    protected function getModelFactory(): ModelFactory
48
    {
49
        return $this->modelFactory;
50
    }
51
}
52