CatalogServiceEndpoints::genInfo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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