/**
  * phpValue
  *
  * @param mixed $param
  * @access public
  * @return mixed
  */
 protected function getPhpValue($value)
 {
     switch (true) {
         case is_bool($value):
             return $value ? 'true' : 'false';
         case is_numeric($value):
             return ctype_digit($value) ? intval($value) : floatval($value);
         case in_array($value, static::$boolish):
             return 'false' === $value || 'no' === $value ? false : true;
         default:
             return clear_value(trim($value));
     }
 }
Example #2
0
 /**
  * convert boolish and numeric values
  *
  * @param mixed $text
  * @param array $attributes
  */
 protected function prepareTextValue(SimpleXMLElement $xml, $attributes = null)
 {
     return isset($attributes['type']) && 'text' === $attributes['type'] ? clear_value((string) $xml) : $this->getValue((string) $xml);
 }