ClientAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setClient() 0 3 1
A getClient() 0 3 1
1
<?php namespace Phabricator;
2
3
use Phabricator\Client\ClientInterface;
4
5
/**
6
 * Client aware trait
7
 *
8
 * Phabricator PHP API
9
 *
10
 * @author Zoltán Borsos <[email protected]>
11
 * @package Phabricator
12
 *
13
 * @copyright    Copyright 2016, Zoltán Borsos.
14
 * @license      https://github.com/Zolli/Phabricator-PHP-API/blob/master/LICENSE.md
15
 * @link         https://github.com/Zolli/Phabricator-PHP-API
16
 */
17
trait ClientAwareTrait {
18
19
    /**
20
     * @type \Phabricator\Client\ClientInterface
21
     */
22
    protected $client;
23
24
    /**
25
     * set the current client implementation
26
     *
27
     * @param \Phabricator\Client\ClientInterface $client
28
     */
29 10
    public function setClient(ClientInterface $client) {
30 10
        $this->client = $client;
31 10
    }
32
33
    /**
34
     * returns the currently used client
35
     *
36
     * @return \Phabricator\Client\ClientInterface
37
     */
38 4
    public function getClient() {
39 4
        return $this->client;
40
    }
41
42
}