| 1 |
<?php |
| 2 |
/** |
| 3 |
* StringConfigParameter.php |
| 4 |
* |
| 5 |
* The StringConfigParameter 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 |
*/ |
| 15 |
namespace UserAccessManager\Config; |
| 16 |
|
| 17 |
class StringConfigParameter extends ConfigParameter |
| 18 |
{ |
| 19 |
/** |
| 20 |
* StringConfigParameter constructor. |
| 21 |
* |
| 22 |
* @param string $id |
| 23 |
* @param string $defaultValue |
| 24 |
* |
| 25 |
* @throws \Exception |
| 26 |
*/ |
| 27 |
public function __construct($id, $defaultValue = '') |
| 28 |
{ |
| 29 |
parent::__construct($id, $defaultValue); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Checks if the given value is a string. |
| 34 |
* |
| 35 |
* @param mixed $value |
| 36 |
* |
| 37 |
* @return bool |
| 38 |
*/ |
| 39 |
public function isValidValue($value) |
| 40 |
{ |
| 41 |
return is_string($value) === true; |
| 42 |
} |
| 43 |
} |
| 44 |
|