mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
22 lines
493 B
PHP
22 lines
493 B
PHP
<?php
|
|
|
|
namespace Safe;
|
|
|
|
use Safe\Exceptions\XmlrpcException;
|
|
|
|
/**
|
|
* Sets xmlrpc type, base64 or datetime, for a PHP string value.
|
|
*
|
|
* @param string|DateTime $value Value to set the type
|
|
* @param string $type 'base64' or 'datetime'
|
|
* @throws XmlrpcException
|
|
*
|
|
*/
|
|
function xmlrpc_set_type(string &$value, string $type): void
|
|
{
|
|
error_clear_last();
|
|
$result = \xmlrpc_set_type($value, $type);
|
|
if ($result === false) {
|
|
throw XmlrpcException::createFromPhpError();
|
|
}
|
|
}
|