CorrectionRequest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 7 3
A import() 0 7 3
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\etxtru\request;
8
9
class CorrectionRequest extends \carono\etxtru\RequestAbstract
10
{
11
	/**
12
	 * Функция создает задание на коррекцию.
13
	 *
14
	 * @param \carono\etxtru\config\CorrectionAddConfig|array $config
15
	 * @return \carono\etxtru\response\AddResponse|\stdClass
16
	 */
17
	public function add($config)
18
	{
19
		$params = [];
20
		foreach ($config instanceof \carono\etxtru\ConfigAbstract ? $config->toArray() : $config as $key => $value) {
21
		    $params[$key] = $value;
22
		}
23
		return $this->getClient()->getContent('correction.add', $params, 'carono\etxtru\response\AddResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...\response\AddResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\AddResponse|stdClass.
Loading history...
24
	}
25
26
27
	/**
28
	 * Функция создает задание на коррецию из заказов и статей.
29
	 *
30
	 * @param \carono\etxtru\config\CorrectionImportConfig|array $config
31
	 * @return \carono\etxtru\response\ImportResponse|\stdClass
32
	 */
33
	public function import($config)
34
	{
35
		$params = [];
36
		foreach ($config instanceof \carono\etxtru\ConfigAbstract ? $config->toArray() : $config as $key => $value) {
37
		    $params[$key] = $value;
38
		}
39
		return $this->getClient()->getContent('correction.import', $params, 'carono\etxtru\response\ImportResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...sponse\ImportResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\ImportResponse|stdClass.
Loading history...
40
	}
41
}
42