Completed
Push — master ( b8ee44...86e435 )
by Jim
02:27
created

ApiAlias::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
    public function __construct()
16
    {
17
        $reflectionObject = new \ReflectionClass(API::class);
18
        parent::__construct($reflectionObject->getConstants());
19
    }
20
21
    public function get($key, $default = null)
22
    {
23
        $value = parent::get($key, $default);
24
25
        return is_null($value) ? $key : $value;
26
    }
27
28
    public function offsetGet($offset)
29
    {
30
        return $this->get($offset);
31
    }
32
}
33