| @@ -1,5 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * ConfigParameterFactory.php | |
| 4 | + * | |
| 5 | + * The ConfigParameterFactory class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <alexanderschneider85@gmail.com> | |
| 10 | + * @copyright 2008-2017 Alexander Schneider | |
| 11 | + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 | |
| 12 | + * @version SVN: $id$ | |
| 13 | + * @link http://wordpress.org/extend/plugins/user-access-manager/ | |
| 14 | + */ | |
| 2 | 15 | |
| 3 | 16 | declare(strict_types=1); |
| 4 | 17 | |
| 5 | 18 | namespace UserAccessManager\Config; |
| @@ -5,33 +18,51 @@ | ||
| 5 | 18 | namespace UserAccessManager\Config; |
| 6 | 19 | |
| 7 | 20 | use Exception; |
| 8 | 21 | |
| 22 | +/** | |
| 23 | + * Class ConfigParameterFactory | |
| 24 | + * | |
| 25 | + * @package UserAccessManager\Config | |
| 26 | + */ | |
| 9 | 27 | class ConfigParameterFactory |
| 10 | 28 | { |
| 11 | 29 | /** |
| 30 | + * Creates a boolean config parameter object. | |
| 31 | + * @param string $id | |
| 32 | + * @param mixed $defaultValue | |
| 33 | + * @return BooleanConfigParameter | |
| 12 | 34 | * @throws Exception |
| 13 | 35 | */ |
| 14 | - public function createBooleanConfigParameter(string $id, mixed $defaultValue = false): BooleanConfigParameter | |
| 36 | + public function createBooleanConfigParameter(string $id, $defaultValue = false): BooleanConfigParameter | |
| 15 | 37 | { |
| 16 | 38 | return new BooleanConfigParameter($id, $defaultValue); |
| 17 | 39 | } |
| 18 | 40 | |
| 19 | 41 | /** |
| 42 | + * Creates a selection config parameter object. | |
| 43 | + * @param string $id | |
| 44 | + * @param mixed $defaultValue | |
| 45 | + * @param array $selection | |
| 46 | + * @return SelectionConfigParameter | |
| 20 | 47 | * @throws Exception |
| 21 | 48 | */ |
| 22 | 49 | public function createSelectionConfigParameter( |
| 23 | 50 | string $id, |
| 24 | - mixed $defaultValue, | |
| 25 | - array $selection | |
| 51 | + $defaultValue, | |
| 52 | + array $selection | |
| 26 | 53 | ): SelectionConfigParameter { |
| 27 | 54 | return new SelectionConfigParameter($id, $defaultValue, $selection); |
| 28 | 55 | } |
| 29 | 56 | |
| 30 | 57 | /** |
| 58 | + * Creates a string config parameter object. | |
| 59 | + * @param string $id | |
| 60 | + * @param mixed $defaultValue | |
| 61 | + * @return StringConfigParameter | |
| 31 | 62 | * @throws Exception |
| 32 | 63 | */ |
| 33 | - public function createStringConfigParameter(string $id, mixed $defaultValue = ''): StringConfigParameter | |
| 64 | + public function createStringConfigParameter(string $id, $defaultValue = ''): StringConfigParameter | |
| 34 | 65 | { |
| 35 | 66 | return new StringConfigParameter($id, $defaultValue); |
| 36 | 67 | } |
| 37 | 68 | } |