Completed
Push — master ( 41aa8c...a24106 )
by Julien
03:40
created

Segments   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getList() 0 12 2
1
<?php
2
3
namespace EncreInformatique\DoctorSenderApi\Endpoints;
4
5
class Segments extends Endpoint
6
{
7
    /*
8
     * SoapClient $client
9
     */
10
    private $client;
11
12
    public function __construct($client)
13
    {
14
        $this->client = $client;
15
    }
16
17
    /**
18
     * We get the List of Users.
19
     *
20
     * @param $options
21
     */
22
    public function getList($options)
23
    {
24
        if (!isset($options['name'])) {
25
            return ['error' => true, 'msg' => 'no name of list was provided'];
26
        }
27
        $listName = str_replace("list_", "", $options['name']);
28
29
        return $this->client->webservice(
30
            'dsSegmentsGetByListName',
31
            array($listName)
32
        );
33
    }
34
}
35