Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class FormYandexCounter extends Model |
||
14 | { |
||
15 | public $counter; |
||
16 | |||
17 | private $_counters; |
||
18 | |||
19 | /** |
||
20 | * FormYandexCounter constructor. |
||
21 | * @param array $counters |
||
22 | */ |
||
23 | public function __construct(array $counters) |
||
24 | { |
||
25 | $this->_counters = $counters; |
||
26 | parent::__construct(false); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Validation rules |
||
31 | * @return array |
||
32 | */ |
||
33 | public function rules(): array |
||
34 | { |
||
35 | return [ |
||
36 | ['counter', 'required'], |
||
37 | ['counter', 'int'] |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Save counter id to configuration file |
||
43 | */ |
||
44 | public function make() |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Get counter id->name |
||
54 | * @return array |
||
55 | */ |
||
56 | public function getCounters(): array |
||
59 | } |
||
60 | } |