| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class FormSettings extends Model |
||
| 12 | { |
||
| 13 | public $count; |
||
| 14 | public $snippet; |
||
| 15 | public $cache; |
||
| 16 | |||
| 17 | private $_configs; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * FormSettings constructor. Pass configs inside from controller |
||
| 21 | * @param array|null $configs |
||
| 22 | */ |
||
| 23 | public function __construct(array $configs = null) |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set default values from configs |
||
| 31 | */ |
||
| 32 | public function before() |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Labels for form display |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function labels(): array |
||
| 44 | { |
||
| 45 | return [ |
||
| 46 | 'snippet' => __('Max length'), |
||
| 47 | 'count' => __('Comments count'), |
||
| 48 | 'cache' => __('Cache') |
||
| 49 | ]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Settings validation rules |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | public function rules(): array |
||
| 61 | ]; |
||
| 62 | } |
||
| 64 |