32 $size = static::INTEGER_BITS;
42 $value = (int) $value;
47 if (is_int($value) && strlen(base_convert($value, 10, 2)) < $size) {
54 throw new \InvalidArgumentException(
"A $size-bit signed integer was expected");
59 public function write(\XMLWriter $writer, \DateTimeZone $timezone, $stringTag)
61 if (strpos(static::XMLRPC_TYPE,
'}') !==
false) {
62 list($ns, $tagName) = explode(
'}', static::XMLRPC_TYPE, 2);
63 $ns = (string) substr($ns, 1);
64 return $writer->writeElementNS(
'ex', $tagName, $ns, (
string) $this);
66 return $writer->writeElement(static::XMLRPC_TYPE, (
string) $this);
write(\XMLWriter $writer,\DateTimeZone $timezone, $stringTag)
$value
Current value associated with this object.
A class representing an abstract XML-RPC type.
Abstract class for fixed-length integer types.