Insights   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 6 1
A __get() 0 10 2
1
<?php
2
3
namespace Clarify;
4
5
/**
6
 * Class Tracks
7
 * @package Clarify
8
 */
9
class Insights extends Subresource
10
{
11
    protected $subresource = 'clarify:insights';
12
13
    public function get($insight)
14
    {
15
        $this->detail = $this->client->get($insight);
16
17
        return $this->detail;
18
    }
19
20
    public function __get($name)
21
    {
22
        $data = $this->detail['track_data'][0];
23
24
        if (array_key_exists($name, $data)) {
25
            return $data[$name];
26
        }
27
28
        throw new \Clarify\Exceptions\InvalidResourceException("The key '$name' was not found.");
29
    }
30
}