| Total Complexity | 3 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class CreateReviewDefaults extends Defaults |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @return array |
||
| 12 | */ |
||
| 13 | public $mapped = [ |
||
| 14 | '_post_id' => 'post_id', |
||
| 15 | '_referer' => 'referer', |
||
| 16 | 'assign_to' => 'assigned_posts', // support custom assign_to fields |
||
| 17 | 'category' => 'assigned_terms', // support custom category fields |
||
| 18 | 'author' => 'name', |
||
| 19 | 'pinned' => 'is_pinned', |
||
| 20 | ]; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return array |
||
| 24 | */ |
||
| 25 | public $sanitize = [ |
||
| 26 | 'assigned_posts' => 'array-int', |
||
| 27 | 'assigned_terms' => 'array-int', |
||
| 28 | 'assigned_users' => 'array-int', |
||
| 29 | 'avatar' => 'url', |
||
| 30 | 'content' => 'text-multiline', |
||
| 31 | 'custom' => 'array', |
||
| 32 | 'date' => 'date', |
||
| 33 | 'email' => 'user-email', |
||
| 34 | 'form_id' => 'int', |
||
| 35 | 'ip_address' => 'text', |
||
| 36 | 'is_pinned' => 'bool', |
||
| 37 | 'name' => 'user-name', |
||
| 38 | 'post_id' => 'int', |
||
| 39 | 'rating' => 'int', |
||
| 40 | 'referer' => 'text', |
||
| 41 | 'response' => 'text', |
||
| 42 | 'terms' => 'bool', |
||
| 43 | 'terms_exist' => 'bool', |
||
| 44 | 'title' => 'text', |
||
| 45 | 'type' => 'text', |
||
| 46 | 'url' => 'url', |
||
| 47 | ]; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return array |
||
| 51 | */ |
||
| 52 | 15 | protected function defaults() |
|
| 76 | ]; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return array |
||
| 81 | */ |
||
| 82 | 15 | protected function normalize(array $values = []) |
|
| 90 |