| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function __construct( $input ) |
||
| 25 | { |
||
| 26 | $this->ajaxRequest = isset( $input['ajax_request'] ); |
||
| 27 | $this->assignedTo = is_numeric( $input['assign_to'] ) |
||
| 28 | ? $input['assign_to'] |
||
| 29 | : ''; |
||
| 30 | $this->author = sanitize_text_field( $input['name'] ); |
||
| 31 | $this->blacklisted = false; |
||
| 32 | $this->category = sanitize_key( $input['category'] ); |
||
| 33 | $this->content = sanitize_textarea_field( $input['content'] ); |
||
| 34 | $this->email = sanitize_email( $input['email'] ); |
||
| 35 | $this->formId = sanitize_key( $input['id'] ); |
||
| 36 | $this->ipAddress = glsr( Helper::class )->getIpAddress(); |
||
| 37 | $this->rating = intval( $input['rating'] ); |
||
| 38 | $this->referrer = $input['_wp_http_referer']; |
||
| 39 | $this->request = $input; |
||
| 40 | $this->terms = isset( $input['terms'] ); |
||
| 41 | $this->title = sanitize_text_field( $input['title'] ); |
||
| 42 | } |
||
| 44 |