public static function build_args($args, $defaults) { if (is_object($args)) { $args = get_object_vars($args); } elseif (!is_array($args)) { $args = $this->parse_str($args); } return array_merge($defaults, $args); }