ShiftList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyMap() 0 6 1
A getRuleList() 0 6 1
1
<?php
2
3
namespace alekciy\ofd\providers\taxcom\Request;
4
5
use alekciy\ofd\providers\taxcom\RequestPage;
6
7
/**
8
 * Список смен заданной ККТ.
9
 */
10
class ShiftList extends RequestPage
11
{
12
	public $method = 'GET';
13
	protected $path = '/API/v2/ShiftList';
14
15
	/** @var string Заводской номер фискального накопителя (ФН) */
16
	public $fnFactoryNumber = '';
17
18
	/** @var string Начало периода */
19
	public $start = '';
20
21
	/** @var string Окончание периода */
22
	public $end = '';
23
24
	/**
25
	 * @inheritDoc
26
	 */
27
	public function getPropertyMap(): array
28
	{
29
		return array_merge(parent::getPropertyMap(), [
30
			'fnFactoryNumber' => ['query' => 'fn'],
31
			'start'           => ['query' => 'begin'],
32
			'end'             => ['query' => 'end'],
33
		]);
34
	}
35
36
	/**
37
	 * @inheritDoc
38
	 */
39
	public function getRuleList(): array
40
	{
41
		return array_merge(parent::getRuleList(), [
42
			'fnFactoryNumber' => ['required', ['lengthMin', 1], ['lengthMax', 16]],
43
			'start'           => ['required', ['dateFormat', 'Y-m-d\TH:i:s']],
44
			'end'             => ['required', ['dateFormat', 'Y-m-d\TH:i:s']],
45
		]);
46
	}
47
}