| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace UserAccessManager\Config; |
| 6 |
|
| 7 |
use Exception; |
| 8 |
|
| 9 |
class ConfigParameterFactory |
| 10 |
{ |
| 11 |
/** |
| 12 |
* @throws Exception |
| 13 |
*/ |
| 14 |
public function createBooleanConfigParameter(string $id, mixed $defaultValue = false): BooleanConfigParameter |
| 15 |
{ |
| 16 |
return new BooleanConfigParameter($id, $defaultValue); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* @throws Exception |
| 21 |
*/ |
| 22 |
public function createSelectionConfigParameter( |
| 23 |
string $id, |
| 24 |
mixed $defaultValue, |
| 25 |
array $selection |
| 26 |
): SelectionConfigParameter { |
| 27 |
return new SelectionConfigParameter($id, $defaultValue, $selection); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* @throws Exception |
| 32 |
*/ |
| 33 |
public function createStringConfigParameter(string $id, mixed $defaultValue = ''): StringConfigParameter |
| 34 |
{ |
| 35 |
return new StringConfigParameter($id, $defaultValue); |
| 36 |
} |
| 37 |
} |
| 38 |
|