Code Duplication    Length = 11-11 lines in 4 locations

src/Salesforce.php 4 locations

@@ 65-75 (lines=11) @@
62
     * @param $args
63
     * @return bool
64
     */
65
    private function callCreateOnObject($method, $args)
66
    {
67
        $type = substr($method, 6);
68
        $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type;
69
70
        if (class_exists($class)) {
71
            return (new $class())->create($args[0]);
72
        }
73
74
        return (new BaseObject($type))->create($args[0]);
75
    }
76
77
    private function callUpdateOnObject($method, $args)
78
    {
@@ 77-87 (lines=11) @@
74
        return (new BaseObject($type))->create($args[0]);
75
    }
76
77
    private function callUpdateOnObject($method, $args)
78
    {
79
        $type = substr($method, 6);
80
        $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type;
81
82
        if (class_exists($class)) {
83
            return (new $class())->update($args[0]);
84
        }
85
86
        return (new BaseObject($type))->update($type, $args[0]);
87
    }
88
89
    private function callDeleteOnObject($method, $args)
90
    {
@@ 89-99 (lines=11) @@
86
        return (new BaseObject($type))->update($type, $args[0]);
87
    }
88
89
    private function callDeleteOnObject($method, $args)
90
    {
91
        $type = substr($method, 6);
92
        $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type;
93
94
        if (class_exists($class)) {
95
            return (new $class())->delete($args[0]);
96
        }
97
98
        return (new BaseObject($type))->delete($type, $args[0]);
99
    }
100
101
    private function callGetOnObject($method, $args)
102
    {
@@ 101-111 (lines=11) @@
98
        return (new BaseObject($type))->delete($type, $args[0]);
99
    }
100
101
    private function callGetOnObject($method, $args)
102
    {
103
        $type = substr($method, 3);
104
        $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type;
105
106
        if (class_exists($class)) {
107
            return (new $class())->get($args[0]);
108
        }
109
110
        return (new BaseObject($type))->get($args[0]);
111
    }
112
}
113