PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 7.1.4
Admin Columns v7.1.4
7.1.4 7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / Setting / Component.php
codepress-admin-columns / classes / Setting Last commit date
ComponentFactory 2 days ago Control 2 days ago Type 2 days ago AttributeCollection.php 2 days ago AttributeFactory.php 2 days ago Children.php 2 days ago Component.php 2 days ago ComponentBuilder.php 2 days ago ComponentCollection.php 2 days ago ComponentFactory.php 2 days ago ConditionalComponentFactory.php 2 days ago ConditionalComponentFactoryCollection.php 2 days ago Config.php 2 days ago ConfigCollection.php 2 days ago ConfigFactory.php 2 days ago Context.php 2 days ago Control.php 2 days ago DefaultSettingsBuilder.php 2 days ago Encoder.php 2 days ago Formatter.php 2 days ago FormatterCollection.php 2 days ago
Component.php
144 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC\Setting;
6
7 use AC\Expression\NullSpecification;
8 use AC\Expression\Specification;
9 use AC\FormatterCollection;
10 use AC\Setting\Control\Input;
11 use InvalidArgumentException;
12
13 class Component
14 {
15 private ?string $label;
16
17 private ?string $description;
18
19 private ?Input $input;
20
21 private FormatterCollection $formatters;
22
23 private ?Children $children;
24
25 private $conditions;
26
27 private AttributeCollection $attributes;
28
29 private string $type;
30
31 public function __construct(
32 ?string $label = null,
33 ?string $description = null,
34 ?Input $input = null,
35 ?Specification $conditions = null,
36 ?FormatterCollection $formatters = null,
37 ?Children $children = null,
38 ?AttributeCollection $attributes = null,
39 ?string $type = null
40 ) {
41 if ($conditions === null) {
42 $conditions = new NullSpecification();
43 }
44
45 if ($formatters === null) {
46 $formatters = new FormatterCollection();
47 }
48
49 if ($attributes === null) {
50 $attributes = new AttributeCollection();
51 }
52
53 if ($type === null) {
54 $type = 'default';
55 }
56
57 $this->label = $label;
58 $this->description = $description;
59 $this->input = $input;
60 $this->formatters = $formatters;
61 $this->children = $children;
62 $this->conditions = $conditions;
63 $this->attributes = $attributes;
64 $this->type = $type;
65 }
66
67 public function has_label(): bool
68 {
69 return $this->label !== null;
70 }
71
72 public function get_label(): string
73 {
74 if ($this->label === null) {
75 throw new InvalidArgumentException('No label provided.');
76 }
77
78 return $this->label;
79 }
80
81 public function has_description(): bool
82 {
83 return $this->description !== null;
84 }
85
86 public function get_description(): string
87 {
88 if ($this->description === null) {
89 throw new InvalidArgumentException('No description provided');
90 }
91
92 return $this->description;
93 }
94
95 public function has_input(): bool
96 {
97 return $this->input !== null;
98 }
99
100 public function get_input(): Input
101 {
102 if ($this->input === null) {
103 throw new InvalidArgumentException('No input provided.');
104 }
105
106 return $this->input;
107 }
108
109 public function get_formatters(): FormatterCollection
110 {
111 return $this->formatters;
112 }
113
114 public function has_children(): bool
115 {
116 return $this->children !== null;
117 }
118
119 public function get_children(): Children
120 {
121 if ($this->children === null) {
122 throw new InvalidArgumentException('No children provided.');
123 }
124
125 return $this->children;
126 }
127
128 public function get_conditions(): Specification
129 {
130 return $this->conditions;
131 }
132
133 public function get_attributes(): AttributeCollection
134 {
135 return $this->attributes;
136 }
137
138 public function get_type(): string
139 {
140 return $this->type;
141 }
142
143 }
144