Completed
Push — master ( c14aad...5ba59a )
by Denis
06:56
created

UserCollection::getUrl()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.2109

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 5
cts 8
cp 0.625
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 2
crap 2.2109
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dp
5
 * Date: 26.07.17
6
 * Time: 12:25
7
 */
8
9
namespace Lan\Ebs\Sdk\Collection;
10
11
use Exception;
12
use Lan\Ebs\Sdk\Classes\Collection;
13
use Lan\Ebs\Sdk\Client;
14
use Lan\Ebs\Sdk\Model\User;
15
16 View Code Duplication
class UserCollection extends Collection
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * UserCollection constructor.
20
     * @param Client $client
21
     * @param array $fields
22
     * @param int $limit
23
     * @param int $offset
24
     * @throws Exception
25
     */
26 1
    public function __construct(Client $client, array $fields = [], $limit = 10, $offset = 0)
27
    {
28 1
        parent::__construct($client, $fields, User::class, $limit, $offset);
29 1
    }
30
31
    /**
32
     * @param $method
33
     * @param array $params
34
     * @return array
35
     * @throws Exception
36
     */
37 1
    public function getUrl($method, array $params = [])
38
    {
39
        switch ($method) {
40 1
            case 'load':
41
                return [
42 1
                    'url' => '/1.0/security/user',
43 1
                    'method' => 'GET',
44
                    'code' => '200'
45 1
                ];
46
            default:
47
                throw new Exception('Route for ' . $method . ' not found');
48
        }
49
    }
50
}