ClientObject   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 29
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClient() 0 4 1
1
<?php
2
namespace Slack;
3
4
/**
5
 * An object fetched from the Slack API.
6
 */
7
abstract class ClientObject extends DataObject
8
{
9
    /**
10
     * @var ApiClient The API client the object belongs to.
11
     */
12
    protected $client;
13
14
    /**
15
     * Creates a client object from a data array.
16
     *
17
     * @param ApiClient $client The API client the object belongs to.
18
     * @param array     $data   An array of model data.
19
     */
20 38
    public function __construct(ApiClient $client, array $data)
21
    {
22 38
        $this->client = $client;
23 38
        $this->data = $data;
24 38
    }
25
26
    /**
27
     * Gets the client object that created the object.
28
     *
29
     * @return ApiClient The client object that created the object.
30
     */
31
    public function getClient()
32
    {
33
        return $this->client;
34
    }
35
}
36