• Prepares a given method call by:

    • extracting a functional interface
    • create a field of that type
    • initialize the field with the called method
    • replace the call with invocation of the field method

    Parameters

    • $method: null | Method = null
    • $call: null | Call = null
    • $fieldLocation: undefined | null | Class = null
    • newFile: boolean = true
    • $funcInterface: undefined | null | InterfaceType = null

    Returns {
        $field: null;
        $interface: null | InterfaceType;
        $interfaceMethod: undefined;
        defaultMethod: undefined;
    } | {
        $field: undefined | Field;
        $interface: InterfaceType;
        $interfaceMethod: undefined | Method;
        defaultMethod: string;
    }