ArticlesRequest::buy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\etxtru\request;
8
9
class ArticlesRequest extends \carono\etxtru\RequestAbstract
10
{
11
	/**
12
	 * Возвращает список готовых статей на продажу. Поле "Описание статьи" не выводится во избежание
13
	 * автоматической выемки всех описаний статей.
14
	 *
15
	 * @param \carono\etxtru\config\ArticlesGetListConfig|array $config
16
	 * @return \carono\etxtru\response\GetListResponse|\stdClass
17
	 */
18
	public function getList($config)
19
	{
20
		$params = [];
21
		foreach ($config instanceof \carono\etxtru\ConfigAbstract ? $config->toArray() : $config as $key => $value) {
22
		    $params[$key] = $value;
23
		}
24
		return $this->getClient()->getContent('articles.getList', $params, 'carono\etxtru\response\GetListResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...ponse\GetListResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\GetListResponse|stdClass.
Loading history...
25
	}
26
27
28
	/**
29
	 * Функция осуществляет покупку указанной статьи текущим пользователем
30
	 *
31
	 * @param int $id Идентификатор покупаемой статьи
32
	 * @return \carono\etxtru\response\BuyResponse|\stdClass
33
	 */
34
	public function buy($id)
35
	{
36
		$params = [
37
			'id' => $id
38
		];
39
		return $this->getClient()->getContent('articles.buy', $params, 'carono\etxtru\response\BuyResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...\response\BuyResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\BuyResponse|stdClass.
Loading history...
40
	}
41
42
43
	/**
44
	 * Функция выводит тексты запрошенных купленных статей
45
	 *
46
	 * @param array (int var1, int var2, ...) $id Массив идентификаторов купленных статей
0 ignored issues
show
Documentation Bug introduced by
The doc comment (int at position 1 could not be parsed: Expected ')' at position 1, but found 'int'.
Loading history...
47
	 * @return \carono\etxtru\response\GetTextResponse|\stdClass
48
	 */
49
	public function getText($id)
50
	{
51
		$params = [
52
			'id' => $id
53
		];
54
		return $this->getClient()->getContent('articles.getText', $params, 'carono\etxtru\response\GetTextResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...ponse\GetTextResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\GetTextResponse|stdClass.
Loading history...
55
	}
56
57
58
	/**
59
	 * Функция создает zip архив с текстами и изображениями указанных купленных статей для текущего
60
	 * пользователя
61
	 *
62
	 * @param array (int var1, int var2, ...) $id Массив идентификаторов купленных статей
0 ignored issues
show
Documentation Bug introduced by
The doc comment (int at position 1 could not be parsed: Expected ')' at position 1, but found 'int'.
Loading history...
63
	 * @return \carono\etxtru\response\DownloadResponse|\stdClass
64
	 */
65
	public function download($id)
66
	{
67
		$params = [
68
			'id' => $id
69
		];
70
		return $this->getClient()->getContent('articles.download', $params, 'carono\etxtru\response\DownloadResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...onse\DownloadResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\DownloadResponse|stdClass.
Loading history...
71
	}
72
}
73