XRL  latest
Simple XML-RPC Library (both client and server)
Double.php
1 <?php
2 /*
3  * This file is part of XRL, a simple XML-RPC Library for PHP.
4  *
5  * Copyright (c) 2012, XRL Team. All rights reserved.
6  * XRL is licensed under the 3-clause BSD License.
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace fpoirotte\XRL\Types;
13 
21 {
23  public function set($value)
24  {
25  if (!is_double($value)) {
26  throw new \InvalidArgumentException('Expected double value');
27  }
28  $this->value = $value;
29  }
30 
32  public function write(\XMLWriter $writer, \DateTimeZone $timezone, $stringTag)
33  {
34  $writer->writeElement('double', $this->value);
35  }
36 
38  protected static function parse($value, \DateTimeZone $timezone = null)
39  {
41  return (double) $value;
42  }
43 }
The XML-RPC "double" type.
Definition: Double.php:20
write(\XMLWriter $writer,\DateTimeZone $timezone, $stringTag)
Definition: Double.php:32
$value
Current value associated with this object.
static parse($value,\DateTimeZone $timezone=null)
Definition: Double.php:38
A class representing an abstract XML-RPC type.