HealthServiceEndpoints::addParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * /health/service/:service
4
 * User: moyo
5
 * Date: 20/11/2017
6
 * Time: 6:08 PM
7
 */
8
9
namespace Carno\Consul\APIs;
10
11
class HealthServiceEndpoints extends AbstractEndpointsLister
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $uri = '/health/service/:service';
17
18
    /**
19
     * @param array $endpoint
20
     * @return array
21
     */
22
    protected function genInfo(array $endpoint) : array
23
    {
24
        return [
25
            $endpoint['Service']['ID'],
26
            $endpoint['Service']['Service'],
27
            $endpoint['Service']['Address'],
28
            $endpoint['Service']['Port'],
29
            $endpoint['Service']['Tags']
30
        ];
31
    }
32
33
    /**
34
     * add some params in url
35
     */
36
    protected function addParams() : void
37
    {
38
        $this->setQuery('passing', 'true');
39
    }
40
}
41