pub fn new(
        sig: &'a syn::Signature,
        name: String,
        args: Args<'a>,
        optional: Option<Ident>,
        docs: Vec<String>,
    ) -> Self {
        Self {
            ident: &sig.ident,
            name,
            args,
            output: match &sig.output {
                syn::ReturnType::Default => None,
                syn::ReturnType::Type(_, ty) => Some(&**ty),
            },
            optional,
            docs,
        }
    }
Parse a function.

# Parameters

* `sig` - Function signature.
* `name` - Function name in PHP land.
* `args` - Function arguments.
* `optional` - The ident of the first optional argument.
crates/macros/src/function.rs