PluginProbe
The Innovative Form Builder – IvyForms / 0.8
The Innovative Form Builder – IvyForms v0.8
1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 1.2 1.3
ivyforms / backend / src / ValueObjects / Field / FieldOptions.php

FieldOptions.php in The Innovative Form Builder – IvyForms 0.8, at backend/src/ValueObjects/Field/FieldOptions.php

52 lines 975 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\ValueObjects\Field;
4
5 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 /**
11 * Class FieldOptions
12 *
13 * Encapsulates options for a field.
14 */
15 final class FieldOptions
16 {
17 /**
18 * @var array<int, array<string, int|string|bool>>
19 */
20 private array $options;
21
22 /**
23 * FieldOptions constructor.
24 *
25 * @param array<int, array<string, int|string|bool>> $options
26 */
27 public function __construct(array $options)
28 {
29 $this->options = $options;
30 }
31
32 /**
33 * Get the options array.
34 *
35 * @return array<int, array<string, int|string|bool>>
36 */
37 public function getOptions(): array
38 {
39 return $this->options;
40 }
41
42 /**
43 * Convert the field options to an array.
44 *
45 * @return array<int, array<string, int|string|bool>>
46 */
47 public function toArray(): array
48 {
49 return $this->options;
50 }
51 }
52