| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function __construct(array $rules = []) |
||
| 14 | { |
||
| 15 | parent::__construct( |
||
| 16 | [ |
||
| 17 | 'code' => [_('Code'), 'required|size:2|regex:/^[a-z]+$/|unique:languages,code{excludeCurrentId}'], |
||
| 18 | 'name' => [_('Name'), 'required|max:255|unique:languages,name{excludeCurrentId}'], |
||
| 19 | 'native_name' => [_('Native name'), 'required|max:255|alpha|unique:languages,native_name{excludeCurrentId}'], |
||
| 20 | 'locale' => [_('Locale'), 'required|size:5|regex:/^[a-z]+_[A-Z]+$/'], |
||
| 21 | 'is_default' => [_('Default'), 'required|integer|min:0|max:1'], |
||
| 22 | ] |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | } |
||
| 26 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.