Completed
Pull Request — master (#16)
by Mischa
19:07 queued 12:02
created

AbstractApiClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 36
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of the PHP SDK library for the Superdesk Content API.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace Superdesk\ContentApiSdk\Client;
16
17
use Superdesk\ContentApiSdk\API\Authentication\AuthenticationInterface;
18
19
abstract class AbstractApiClient implements ApiClientInterface
20
{
21
    const MAX_RETRY_LIMIT = 3;
22
23
    /**
24
     * HTTP client.
25
     *
26
     * @var ClientInterface
27
     */
28
    protected $client;
29
30
    /**
31
     * Authentication object.
32
     *
33
     * @var AuthenticationInterface
34
     */
35
    protected $authenticator;
36
37
    /**
38
     * Retry limit counter for authentication.
39
     *
40
     * @var int
41
     */
42
    protected $authenticationRetryLimit = 0;
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function __construct(
48
        ClientInterface $client,
49
        AuthenticationInterface $authenticator
50
    ) {
51
        $this->client = $client;
52
        $this->authenticator = $authenticator;
53
    }
54
}
55