OutletList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyMap() 0 5 1
A getRuleList() 0 8 1
1
<?php
2
3
namespace alekciy\ofd\providers\taxcom\Request;
4
5
use alekciy\ofd\providers\taxcom\RequestPage;
6
use alekciy\ofd\providers\taxcom\Status;
7
8
/**
9
 * Список торговых точек.
10
 */
11
final class OutletList extends RequestPage
12
{
13
	public $method = 'GET';
14
	protected $path = '/API/v2/OutletList';
15
16
	/** @var string Идентификатор */
17
	public $id = '';
18
19
	/** @var string Статус */
20
	public $status = '';
21
22
	/**
23
	 * @inheritDoc
24
	 */
25
	public function getPropertyMap(): array
26
	{
27
		return array_merge(parent::getPropertyMap(), [
28
			'id'     => ['query' => 'id'],
29
			'status' => ['query' => 'np'],
30
		]);
31
	}
32
33
	/**
34
	 * @inheritDoc
35
	 */
36
	public function getRuleList(): array
37
	{
38
		return array_merge(parent::getRuleList(), [
39
			'id' => [['lengthMin', 1], ['lengthMax', 36]],
40
			'status' => [['in', [
41
				Status::OK,
42
				Status::PROBLEM,
43
				Status::WARNING,
44
			]]]
45
		]);
46
	}
47
}
48