Environment::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
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