ClientObject::getClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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