ApiAlias   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
ccs 9
cts 9
cp 1
wmc 4
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get() 0 6 2
A offsetGet() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: lenovo
5
 * Date: 6/23/2018
6
 * Time: 8:13 PM
7
 */
8
9
namespace TimSDK\Core;
10
11
use TimSDK\Support\Collection;
12
13
class ApiAlias extends Collection
14
{
15 3
    public function __construct()
16
    {
17 3
        $reflectionObject = new \ReflectionClass(API::class);
18 3
        parent::__construct($reflectionObject->getConstants());
19 3
    }
20
21 3
    public function get($key, $default = null)
22
    {
23 3
        $value = parent::get($key, $default);
24
25 3
        return is_null($value) ? $key : $value;
26
    }
27
28 3
    public function offsetGet($offset)
29
    {
30 3
        return $this->get($offset);
31
    }
32
}
33