コード例 #1
0
ファイル: String.php プロジェクト: fkooman/php-lib-types
 public function __construct($value = '')
 {
     if (!is_string($value)) {
         throw new InvalidArgumentException("not a string");
     }
     parent::__construct($value);
 }
コード例 #2
0
ファイル: Integer.php プロジェクト: fkooman/php-lib-types
 public function __construct($value)
 {
     if (!is_int($value)) {
         throw new InvalidArgumentException("not an integer");
     }
     parent::__construct($value);
 }
コード例 #3
0
ファイル: Boolean.php プロジェクト: fkooman/php-lib-types
 public function __construct($value)
 {
     if (!is_bool($value)) {
         throw new InvalidArgumentException("not a boolean");
     }
     parent::__construct($value);
 }