BaseEndpoint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A defaultExecutor() 0 3 1
1
<?php namespace Phabricator\Endpoints;
2
3
use Phabricator\Client\ClientInterface;
4
5
/**
6
 * Base class to handle endpoint methods
7
 *
8
 * Phabricator PHP API
9
 *
10
 * @author Zoltán Borsos <[email protected]>
11
 * @package Phabricator
12
 * @subpackage Endpoints
13
 *
14
 * @copyright    Copyright 2016, Zoltán Borsos.
15
 * @license      https://github.com/Zolli/Phabricator-PHP-API/blob/master/LICENSE.md
16
 * @link         https://github.com/Zolli/Phabricator-PHP-API
17
 */
18
class BaseEndpoint {
19
20
    /**
21
     * @type \Phabricator\Client\ClientInterface
22
     */
23
    protected $client;
24
25
    /**
26
     * Constructor
27
     * Set the client in this class
28
     *
29
     * @param \Phabricator\Client\ClientInterface $client
30
     */
31 3
    public function __construct(ClientInterface $client) {
32 3
        $this->client = $client;
33 3
    }
34
35
    /**
36
     * {@inheritdoc}
37
     *
38
     * @codeCoverageIgnore
39
     */
40
    public function defaultExecutor($requestUrl, $requestData) {
41
        return $this->client->request($requestUrl, $requestData);
42
    }
43
44
}