If this is the only place where `$name` is used, then assign it here ...

    $defaults = array('name' => is_array($data) ? '' : $data);