Code Duplication    Length = 21-35 lines in 3 locations

src/collection/BookCollection.php 1 location

@@ 24-44 (lines=21) @@
21
 * @subpackage   Sdk
22
 * @category     Collection
23
 */
24
class BookCollection extends Collection
25
{
26
    /**
27
     * Конструктор коллекции книг
28
     *
29
     * @param Client $client Инстанс клиента
30
     * @param array $fields Поля для выборки
31
     * @param int $limit Лимит выборки моделей книг
32
     * @param int $offset Смещение выборки моделей книг
33
     *
34
     * @throws Exception
35
     */
36
    public function __construct(Client $client, array $fields = [], $limit = 10, $offset = 0)
37
    {
38
        parent::__construct($client, $fields, Book::class, $limit, $offset);
39
    }
40
41
    /**
42
     * /**
43
     * Получение данных для запроса через API
44
     *
45
     * @param string $method Http-метод запроса
46
     * @param array $params Параметры для формирования урла
47
     *

src/collection/JournalCollection.php 1 location

@@ 24-58 (lines=35) @@
21
 * @subpackage   Sdk
22
 * @category     Collection
23
 */
24
class JournalCollection extends Collection
25
{
26
    /**
27
     * BookCollection constructor.
28
     * @param Client $client
29
     * @param array $fields
30
     * @param int $limit
31
     * @param int $offset
32
     * @throws Exception
33
     */
34
    public function __construct(Client $client, array $fields = [], $limit = 10, $offset = 0)
35
    {
36
        parent::__construct($client, $fields, Journal::class, $limit, $offset);
37
    }
38
39
    /**
40
     * Получение данных для запроса через API
41
     *
42
     * @param string $method Http-метод запроса
43
     * @param array $params Параметры для формирования урла
44
     *
45
     * @return array
46
     *
47
     * @throws Exception
48
     */
49
    public function getUrl($method, array $params = [])
50
    {
51
        switch ($method) {
52
            case 'load':
53
                return [
54
                    'url' => '/1.0/resource/journal',
55
                    'method' => 'GET',
56
                    'code' => '200'
57
                ];
58
            default:
59
                throw new Exception('Route for ' . $method . ' not found');
60
        }
61
    }

src/collection/UserCollection.php 1 location

@@ 24-44 (lines=21) @@
21
 * @subpackage   Sdk
22
 * @category     Collection
23
 */
24
class UserCollection extends Collection
25
{
26
    /**
27
     * UserCollection constructor.
28
     *
29
     * @param Client $client
30
     * @param array $fields
31
     * @param int $limit
32
     * @param int $offset
33
     * @throws Exception
34
     */
35
    public function __construct(Client $client, array $fields = [], $limit = 10, $offset = 0)
36
    {
37
        parent::__construct($client, $fields, User::class, $limit, $offset);
38
    }
39
40
    /**
41
     * Получение данных для запроса через API
42
     *
43
     * @param string $method Http-метод запроса
44
     * @param array $params Параметры для формирования урла
45
     *
46
     * @return array
47
     *