XRL
3.0.0
Simple XML-RPC Library (both client and server)
Main Page
Classes
Files
Examples
File List
BigInteger.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
22
class
BigInteger
extends
\fpoirotte\XRL\Types\AbstractInteger
23
{
25
const
XMLRPC_TYPE
=
'{http://ws.apache.org/xmlrpc/namespaces/extensions}biginteger'
;
26
28
public
function
set
(
$value
)
29
{
30
// Versions before PHP 5.6 used resources to represent big numbers
31
// while new versions use objects instead.
32
if
((is_resource(
$value
) && get_resource_type(
$value
) ===
'GMP integer'
) ||
33
(
$value
instanceof \GMP)) {
34
// It is already a GMP integer.
35
}
else
{
36
$value
= @gmp_init(
$value
, 10);
37
}
38
if
(
$value
===
false
) {
39
throw
new \InvalidArgumentException(
"Expected a big integer value"
);
40
}
41
42
$this->value =
$value
;
43
}
44
}
fpoirotte\XRL\Types\AbstractType\$value
$value
Current value associated with this object.
Definition:
AbstractType.php:23
fpoirotte\XRL\Types\BigInteger
The XML-RPC "i8" type.
Definition:
BigInteger.php:22
fpoirotte\XRL\Types\BigInteger\XMLRPC_TYPE
const XMLRPC_TYPE
XML-RPC type for this class.
Definition:
BigInteger.php:25
fpoirotte\XRL\Types\BigInteger\set
set($value)
Definition:
BigInteger.php:28
fpoirotte\XRL\Types\AbstractInteger
Abstract class for fixed-length integer types.
Definition:
AbstractInteger.php:21
src
Types
BigInteger.php
Generated on Sat Oct 29 2016 15:08:07 for XRL by
1.8.6