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
DefaultSettingsBuilder.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Setting; |
| 6 | |
| 7 | class DefaultSettingsBuilder |
| 8 | { |
| 9 | private ComponentFactory\Name $name; |
| 10 | |
| 11 | private ComponentFactory\Label $label; |
| 12 | |
| 13 | private ComponentFactory\Width $width; |
| 14 | |
| 15 | public function __construct( |
| 16 | ComponentFactory\Name $name, |
| 17 | ComponentFactory\Label $label, |
| 18 | ComponentFactory\Width $width |
| 19 | ) { |
| 20 | $this->name = $name; |
| 21 | $this->label = $label; |
| 22 | $this->width = $width; |
| 23 | } |
| 24 | |
| 25 | public function build(Config $config): ComponentCollection |
| 26 | { |
| 27 | return new ComponentCollection([ |
| 28 | $this->name->create($config), |
| 29 | $this->label->create($config), |
| 30 | $this->width->create($config), |
| 31 | ], 5); |
| 32 | } |
| 33 | |
| 34 | } |
| 35 |