Agent::info()   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
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * User agent info
4
 * User: moyo
5
 * Date: 2018/7/23
6
 * Time: 2:46 PM
7
 */
8
9
namespace Carno\HRPC\Client;
10
11
class Agent
12
{
13
    /**
14
     * @var string
15
     */
16
    private $present = null;
17
18
    /**
19
     * Agent constructor.
20
     */
21
    public function __construct()
22
    {
23
        $this->present = sprintf(
24
            'Carno-RPC/1.0 (%s %s; PHP %s) SWOOLE/%s',
25
            php_uname('s'),
26
            php_uname('r'),
27
            PHP_VERSION,
28
            SWOOLE_VERSION
0 ignored issues
show
Bug introduced by
The constant Carno\HRPC\Client\SWOOLE_VERSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
29
        );
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function info() : string
36
    {
37
        return $this->present;
38
    }
39
}
40