CatalogServiceEndpoints   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A genInfo() 0 8 1
A addParams() 0 2 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