public static function cast($num) { if (is_object($num) && Class_::hasMethod($num, '__toString')) { $num = sprintf('%s', $num); } if (!is_numeric($num)) { return 0; } $type = sprintf('\\apf\\type\\%s', \apf\util\Class_::removeNamespace(get_called_class())); return $type::cast($num); }
public function __call($method, $args) { array_unshift($args, $this->value); call_user_func_array(sprintf('\\apf\\validate\\%s::%s', \apf\util\Class_::removeNamespace(__CLASS__), $method), $args); return $this; }