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 / ComponentBuilder.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
ComponentBuilder.php
112 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC\Setting;
6
7 use AC\Expression\Specification;
8 use AC\Formatter;
9 use AC\FormatterCollection;
10 use AC\Setting\Control\Input;
11
12 final class ComponentBuilder
13 {
14 private ?string $label = null;
15
16 private ?string $description = null;
17
18 private ?Input $input = null;
19
20 private ?Specification $conditions = null;
21
22 private ?FormatterCollection $formatters = null;
23
24 private ?Children $children = null;
25
26 private ?AttributeCollection $attributes = null;
27
28 private ?string $type = null;
29
30 public function set_label(string $label): self
31 {
32 $this->label = $label;
33
34 return $this;
35 }
36
37 public function set_description(string $description): self
38 {
39 $this->description = $description;
40
41 return $this;
42 }
43
44 public function set_input(Input $input): self
45 {
46 $this->input = $input;
47
48 return $this;
49 }
50
51 /**
52 * Null conveniently allowed to pass on
53 */
54 public function set_conditions(Specification $conditions): self
55 {
56 $this->conditions = $conditions;
57
58 return $this;
59 }
60
61 public function set_formatters(FormatterCollection $formatters): self
62 {
63 $this->formatters = $formatters;
64
65 return $this;
66 }
67
68 public function set_formatter(Formatter $formatter): self
69 {
70 $formatters = new FormatterCollection();
71 $formatters->add($formatter);
72
73 return $this->set_formatters($formatters);
74 }
75
76 public function set_children(Children $children): self
77 {
78 $this->children = $children;
79
80 return $this;
81 }
82
83 public function set_attributes(AttributeCollection $attributes): self
84 {
85 $this->attributes = $attributes;
86
87 return $this;
88 }
89
90 public function set_type(string $type): self
91 {
92 $this->type = $type;
93
94 return $this;
95 }
96
97 public function build(): Component
98 {
99 return new Component(
100 $this->label,
101 $this->description,
102 $this->input,
103 $this->conditions,
104 $this->formatters,
105 $this->children,
106 $this->attributes,
107 $this->type
108 );
109 }
110
111 }
112