Environment   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 23
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tags() 0 5 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * Env info
4
 * User: moyo
5
 * Date: 2018/7/23
6
 * Time: 10:47 AM
7
 */
8
9
namespace Carno\Traced\Utils;
10
11
use Carno\Tracing\Contracts\Env;
12
use Carno\Tracing\Contracts\Vars\TAG;
13
14
class Environment implements Env
15
{
16
    /**
17
     * @var string
18
     */
19
    private $hostname = 'localhost';
20
21
    /**
22
     * Environment constructor.
23
     */
24
    public function __construct()
25
    {
26
        $this->hostname = gethostname();
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function tags() : array
33
    {
34
        return [
35
            TAG::HOSTNAME => $this->hostname,
36
            TAG::LANG_EXE => 'php',
37
        ];
38
    }
39
}
40