Code Duplication    Length = 3-3 lines in 3 locations

src/Objects/Account.php 1 location

@@ 39-41 (lines=3) @@
36
        $query = 'SELECT Id, OwnerId, Salutation, FirstName, LastName FROM ' . $this->getType() . ' WHERE RecordTypeId = \'' . config('laravel-salesforce.record_type.account') . '\'';
37
38
        $paramsWithKeys = [];
39
        foreach ($params as $fieldName => $fieldValue) {
40
            $paramsWithKeys[] = $fieldName . ' = \'' . addslashes(trim($fieldValue)) . '\'';
41
        }
42
43
        $query .= ' AND (' . implode(' ' . $condition . ' ', $paramsWithKeys) . ')';
44

src/Objects/Lead.php 1 location

@@ 41-43 (lines=3) @@
38
        $query = 'SELECT Id, OwnerId FROM ' . $this->getType() . ' WHERE RecordTypeId = \'' . config('laravel-salesforce.record_type.lead') . '\'';
39
40
        $paramsWithKeys = [];
41
        foreach ($params as $fieldName => $fieldValue) {
42
            $paramsWithKeys[] = $fieldName . ' = \'' . addslashes(trim($fieldValue)) . '\'';
43
        }
44
45
        $query .= ' AND (' . implode(' ' . $condition . ' ', $paramsWithKeys) . ')';
46

src/Objects/User.php 1 location

@@ 26-28 (lines=3) @@
23
        $query = 'SELECT Id, Name, Email, UserType, UserRoleId FROM ' . $this->getType() . ' WHERE ';
24
25
        $paramsWithKeys = [];
26
        foreach ($params as $fieldName => $fieldValue) {
27
            $paramsWithKeys[] = $fieldName . ' = \'' . addslashes(trim($fieldValue)) . '\'';
28
        }
29
30
        $query .= '(' . implode(' ' . $condition . ' ', $paramsWithKeys) . ')';
31