DocumentInfo   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRuleList() 0 5 1
A getPropertyMap() 0 5 1
1
<?php
2
3
namespace alekciy\ofd\providers\taxcom\Request;
4
5
use alekciy\ofd\Request;
6
7
/**
8
 * Информация по фискальному документу (ФД) в тегах.
9
 */
10
class DocumentInfo extends Request
11
{
12
	public $method = 'GET';
13
	protected $path = '/API/v2/DocumentInfo';
14
15
	/** @var string Заводской номер ФН */
16
	public $fnFactoryNumber = '';
17
18
	/** @var integer Номер фискального документа (ФД) */
19
	public $fdNumber = 0;
20
21
	/**
22
	 * @inheritDoc
23
	 */
24
	public function getPropertyMap(): array
25
	{
26
		return [
27
			'fnFactoryNumber' => ['query' => 'fn'],
28
			'fdNumber'        => ['query' => 'fd'],
29
		];
30
	}
31
32
	/**
33
	 * @inheritDoc
34
	 */
35
	public function getRuleList(): array
36
	{
37
		return [
38
			'fnFactoryNumber' => ['required', ['lengthMin', 1], ['lengthMax', 16]],
39
			'fdNumber'        => ['required', 'integer'],
40
		];
41
	}
42
}