Source of file Boolean.php
Size: 1,069 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/XmlRpc/Value/Boolean.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\XmlRpc\Value; class Boolean extends AbstractScalar { /** * Set the value of a boolean native type * We hold the boolean type as an integer (0 or 1) * * @param bool $value */ public function __construct($value) { $this->type = self::XMLRPC_TYPE_BOOLEAN; // Make sure the value is boolean and then convert it into an integer // The double conversion is because a bug in the ZendOptimizer in PHP version 5.0.4 $this->value = (int)(bool) $value; } /** * Return the value of this object, convert the XML-RPC native boolean value into a PHP boolean * * @return bool */ public function getValue() { return (bool) $this->value; } } |