| @@ -1,69 +1,66 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Give\FormAPI\Form; |
| 4 | 4 | |
| 5 | -class Text extends Field | |
| 6 | -{ | |
| 7 | - /** | |
| 8 | - * Before field. | |
| 9 | - * | |
| 10 | - * @since 2.7.0 | |
| 11 | - * @var string | |
| 12 | - */ | |
| 13 | - public $beforeField = ''; | |
| 5 | +class Text extends Field { | |
| 6 | + /** | |
| 7 | + * Before field. | |
| 8 | + * | |
| 9 | + * @since 2.7.0 | |
| 10 | + * @var string | |
| 11 | + */ | |
| 12 | + public $beforeField = ''; | |
| 14 | 13 | |
| 15 | - /** | |
| 16 | - * after field. | |
| 17 | - * | |
| 18 | - * @since 2.7.0 | |
| 19 | - * @var string | |
| 20 | - */ | |
| 21 | - public $afterField = ''; | |
| 14 | + /** | |
| 15 | + * after field. | |
| 16 | + * | |
| 17 | + * @since 2.7.0 | |
| 18 | + * @var string | |
| 19 | + */ | |
| 20 | + public $afterField = ''; | |
| 22 | 21 | |
| 23 | - /** | |
| 24 | - * Field value type. | |
| 25 | - * Note: this param value can be price and decimal. | |
| 26 | - * | |
| 27 | - * @since 2.7.0 | |
| 28 | - * @var string | |
| 29 | - */ | |
| 30 | - public $dataType = ''; | |
| 22 | + /** | |
| 23 | + * Field value type. | |
| 24 | + * Note: this param value can be price and decimal. | |
| 25 | + * | |
| 26 | + * @since 2.7.0 | |
| 27 | + * @var string | |
| 28 | + */ | |
| 29 | + public $dataType = ''; | |
| 31 | 30 | |
| 32 | - /** | |
| 33 | - * Field value type. | |
| 34 | - * Note: this param value can be price and decimal. | |
| 35 | - * | |
| 36 | - * @since 2.7.0 | |
| 37 | - * @var string | |
| 38 | - */ | |
| 39 | - public $size = ''; | |
| 31 | + /** | |
| 32 | + * Field value type. | |
| 33 | + * Note: this param value can be price and decimal. | |
| 34 | + * | |
| 35 | + * @since 2.7.0 | |
| 36 | + * @var string | |
| 37 | + */ | |
| 38 | + public $size = ''; | |
| 40 | 39 | |
| 41 | - /** | |
| 42 | - * @inheritDoc | |
| 43 | - */ | |
| 44 | - public function parse($array) | |
| 45 | - { | |
| 46 | - parent::parse($array); | |
| 40 | + /** | |
| 41 | + * @inheritDoc | |
| 42 | + */ | |
| 43 | + public function parse( $array ) { | |
| 44 | + parent::parse( $array ); | |
| 47 | 45 | |
| 48 | - $this->beforeField = isset($array['before_field']) ? $array['before_field'] : ''; | |
| 49 | - $this->afterField = isset($array['after_field']) ? $array['after_field'] : ''; | |
| 50 | - $this->dataType = isset($array['data_type']) ? $array['data_type'] : ''; | |
| 46 | + $this->beforeField = isset( $array['before_field'] ) ? $array['before_field'] : ''; | |
| 47 | + $this->afterField = isset( $array['after_field'] ) ? $array['after_field'] : ''; | |
| 48 | + $this->dataType = isset( $array['data_type'] ) ? $array['data_type'] : ''; | |
| 51 | 49 | |
| 52 | - $type = explode('_', $this->type, 2); | |
| 53 | - $this->size = false !== strpos('_', $this->type) ? array_pop($type) : ''; | |
| 54 | - } | |
| 50 | + $type = explode( '_', $this->type, 2 ); | |
| 51 | + $this->size = false !== strpos( '_', $this->type ) ? array_pop( $type ) : ''; | |
| 52 | + } | |
| 55 | 53 | |
| 56 | - /** | |
| 57 | - * @inheritDoc | |
| 58 | - */ | |
| 59 | - public function toArray() | |
| 60 | - { | |
| 61 | - return array_merge( | |
| 62 | - parent::toArray(), | |
| 63 | - [ | |
| 64 | - 'before_field' => $this->beforeField, | |
| 65 | - 'after_field' => $this->afterField, | |
| 66 | - ] | |
| 67 | - ); | |
| 68 | - } | |
| 54 | + /** | |
| 55 | + * @inheritDoc | |
| 56 | + */ | |
| 57 | + public function toArray() { | |
| 58 | + return array_merge( | |
| 59 | + parent::toArray(), | |
| 60 | + [ | |
| 61 | + 'before_field' => $this->beforeField, | |
| 62 | + 'after_field' => $this->afterField, | |
| 63 | + ] | |
| 64 | + ); | |
| 65 | + } | |
| 69 | 66 | } |