Agent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A info() 0 3 1
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