| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function rules() |
||
| 32 | { |
||
| 33 | return [ |
||
| 34 | // Web security |
||
| 35 | ['login, password', 'trim'], |
||
| 36 | ['login, password', 'strip_tags'], |
||
| 37 | ['login, password', 'htmlspecialchars'], |
||
| 38 | // check value elements |
||
| 39 | ['login', 'string', 'min' => 5, 'max' => 16], |
||
| 40 | ['password', 'string', 'min' => 6, 'max' => 32] |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 66 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: