OutletShort   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 18
c 1
b 0
f 0
dl 0
loc 64
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRuleList() 0 10 1
A getId() 0 3 1
A getPropertyInitMap() 0 3 1
A getName() 0 3 1
A getAddress() 0 3 1
1
<?php
2
3
namespace alekciy\ofd\providers\taxcom\Model;
4
5
use alekciy\ofd\BaseModel;
6
use alekciy\ofd\interfaces\OutletInterface;
7
use alekciy\ofd\providers\taxcom\Status;
8
9
/**
10
 * Сокращенная информацию по торговой точке.
11
 */
12
class OutletShort extends BaseModel implements OutletInterface
13
{
14
	/** @var string Адрес торговой точки */
15
	public $address = '';
16
17
	/** @var string Код торговой точки */
18
	public $code = '';
19
20
	/** @var string Идентификатор торговой точки */
21
	public $id = '';
22
23
	/** @var string Название торговой точки */
24
	public $name = '';
25
26
	/** @var string Признак наличия проблемы */
27
	public $problemIndicator = '';
28
29
	/**
30
	 * @inheritDoc
31
	 */
32
	public function getRuleList(): array
33
	{
34
		return [
35
			'id' => ['required', ['lengthMax', 36]],
36
			'name' => ['required', ['lengthMax', 255]],
37
			'code' => [['lengthMax', 10]],
38
			'problemIndicator' => [['in', [
39
				Status::OK,
40
				Status::PROBLEM,
41
				Status::WARNING,
42
			]]]
43
		];
44
	}
45
46
	/**
47
	 * @inheritDoc
48
	 */
49
	public function getId(): string
50
	{
51
		return $this->id;
52
	}
53
54
	/**
55
	 * @inheritDoc
56
	 */
57
	public function getName(): string
58
	{
59
		return $this->name;
60
	}
61
62
	/**
63
	 * @inheritDoc
64
	 */
65
	public function getAddress(): string
66
	{
67
		return $this->address;
68
	}
69
70
	/**
71
	 * @inheritDoc
72
	 */
73
	protected function getPropertyInitMap(): array
74
	{
75
		return [];
76
	}
77
}