| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public static function create(array $data): Validator |
||
| 18 | { |
||
| 19 | $rules = [ |
||
| 20 | 'content' => 'required|min:10', |
||
| 21 | 'article_id' => 'required' |
||
| 22 | ]; |
||
| 23 | |||
| 24 | if (isset($data['content'])) { |
||
| 25 | $data['content'] = Purifier::clean($data['content'], 'blog_comment_empty'); |
||
| 26 | } |
||
| 27 | |||
| 28 | return FacadeValidator::make($data, $rules); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |