| @@ -1,37 +1,63 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -declare(strict_types=1); | |
| 4 | - | |
| 2 | +/** | |
| 3 | + * ConfigParameterFactory.php | |
| 4 | + * | |
| 5 | + * The ConfigParameterFactory class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <[email protected]> | |
| 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 | + */ | |
| 5 | 15 | namespace UserAccessManager\Config; |
| 6 | 16 | |
| 7 | -use Exception; | |
| 8 | - | |
| 17 | +/** | |
| 18 | + * Class ConfigParameterFactory | |
| 19 | + * | |
| 20 | + * @package UserAccessManager\Config | |
| 21 | + */ | |
| 9 | 22 | class ConfigParameterFactory |
| 10 | 23 | { |
| 11 | 24 | /** |
| 12 | - * @throws Exception | |
| 25 | + * Creates a boolean config parameter object. | |
| 26 | + * | |
| 27 | + * @param string $id | |
| 28 | + * @param mixed $defaultValue | |
| 29 | + * | |
| 30 | + * @return BooleanConfigParameter | |
| 13 | 31 | */ |
| 14 | - public function createBooleanConfigParameter(string $id, mixed $defaultValue = false): BooleanConfigParameter | |
| 32 | + public function createBooleanConfigParameter($id, $defaultValue = false) | |
| 15 | 33 | { |
| 16 | 34 | return new BooleanConfigParameter($id, $defaultValue); |
| 17 | 35 | } |
| 18 | 36 | |
| 19 | 37 | /** |
| 20 | - * @throws Exception | |
| 38 | + * Creates a selection config parameter object. | |
| 39 | + * | |
| 40 | + * @param string $id | |
| 41 | + * @param mixed $defaultValue | |
| 42 | + * @param array $selection | |
| 43 | + * | |
| 44 | + * @return SelectionConfigParameter | |
| 21 | 45 | */ |
| 22 | - public function createSelectionConfigParameter( | |
| 23 | - string $id, | |
| 24 | - mixed $defaultValue, | |
| 25 | - array $selection | |
| 26 | - ): SelectionConfigParameter { | |
| 46 | + public function createSelectionConfigParameter($id, $defaultValue, array $selection) | |
| 47 | + { | |
| 27 | 48 | return new SelectionConfigParameter($id, $defaultValue, $selection); |
| 28 | 49 | } |
| 29 | 50 | |
| 30 | 51 | /** |
| 31 | - * @throws Exception | |
| 52 | + * Creates a string config parameter object. | |
| 53 | + * | |
| 54 | + * @param string $id | |
| 55 | + * @param mixed $defaultValue | |
| 56 | + * | |
| 57 | + * @return StringConfigParameter | |
| 32 | 58 | */ |
| 33 | - public function createStringConfigParameter(string $id, mixed $defaultValue = ''): StringConfigParameter | |
| 59 | + public function createStringConfigParameter($id, $defaultValue = '') | |
| 34 | 60 | { |
| 35 | 61 | return new StringConfigParameter($id, $defaultValue); |
| 36 | 62 | } |
| 37 | 63 | } |