AbstractService   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClient() 0 4 1
A getModelFactory() 0 4 1
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