| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | class FrmFieldOption { |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | - * @var int|string | |
| 12 | + * @var string|int | |
| 13 | 13 | * |
| 14 | 14 | * @since 2.03.05 |
| 15 | 15 | */ |
| 16 | 16 | protected $option_key; |
| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | protected $option_key; |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * @var array|string | |
| 19 | + * @var string|array | |
| 20 | 20 | * |
| 21 | 21 | * @since 2.03.05 |
| 22 | 22 | */ |
| 23 | 23 | protected $option; |
| @@ -44,14 +44,12 @@ | ||
| 44 | 44 | /** |
| 45 | 45 | * Set the option label |
| 46 | 46 | * |
| 47 | 47 | * @since 2.03.05 |
| 48 | - * | |
| 49 | - * @return void | |
| 50 | 48 | */ |
| 51 | 49 | private function set_option_label() { |
| 52 | 50 | if ( is_array( $this->option ) ) { |
| 53 | - $this->option_label = ( $this->option['label'] ?? reset( $this->option ) ); | |
| 51 | + $this->option_label = ( isset( $this->option['label'] ) ? $this->option['label'] : reset( $this->option ) ); | |
| 54 | 52 | } else { |
| 55 | 53 | $this->option_label = $this->option; |
| 56 | 54 | } |
| 57 | 55 | } |
| @@ -59,10 +57,8 @@ | ||
| 59 | 57 | /** |
| 60 | 58 | * Set the saved value |
| 61 | 59 | * |
| 62 | 60 | * @since 2.03.05 |
| 63 | - * | |
| 64 | - * @return void | |
| 65 | 61 | */ |
| 66 | 62 | protected function set_saved_value() { |
| 67 | 63 | $this->saved_value = $this->option_label; |
| 68 | 64 | } |
| @@ -72,11 +68,9 @@ | ||
| 72 | 68 | * |
| 73 | 69 | * @since 2.03.05 |
| 74 | 70 | * |
| 75 | 71 | * @param string $selected_value |
| 76 | - * @param int $truncate | |
| 77 | - * | |
| 78 | - * @return void | |
| 72 | + * @param int $truncate | |
| 79 | 73 | */ |
| 80 | 74 | public function print_single_option( $selected_value, $truncate ) { |
| 81 | 75 | if ( '' !== $this->saved_value ) { |
| 82 | 76 | echo '<option value="' . esc_attr( $this->saved_value ) . '"'; |