Raw::call()   B
last analyzed

Complexity

Conditions 5
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 11
rs 8.8571
cc 5
eloc 8
nc 1
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Rutube PHP API Client package.
5
 *
6
 * (c) Rutube
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Rutube;
13
14
/**
15
 * Реализация прямых запросов к API
16
 *
17
 * @package Rutube
18
 */
19
class Raw extends Entity
20
{
21
    /**
22
     * Прямой запрос к API Rutube
23
     *
24
     * @param string $method Метод: GET, POST, PUT, PATCH, DELETE
25
     * @param string $url URL метода API, например: api/video/person/
26
     * @param array $options Параметры запроса:
27
     *                          [
28
     *                              'params'=>[],
29
     *                              'query'=>[],
30
     *                              'file'=>[],
31
     *                              'return_code'=>false
32
     *                          ]
33
     * @return mixed
34
     */
35
    public function call($method, $url, $options = array())
36
    {
37
        return $this->getTransport()->call(
38
            $method,
39
            $url,
40
            isset($options['params']) ? $options['params'] : array(),
41
            isset($options['query']) ? $options['query'] : array(),
42
            isset($options['file']) ? $options['file'] : array(),
43
            isset($options['return_code']) ? $options['return_code'] : false
44
        );
45
    }
46
}
47