Code Duplication    Length = 7-10 lines in 2 locations

src/ZohoDatabasePusher.php 2 locations

@@ 137-146 (lines=10) @@
134
     * @param array $fieldsMatching
135
     * @param array $row
136
     */
137
    private function insertDataZohoBean(ZohoBeanInterface $zohoBean, array $fieldsMatching, array $row)
138
    {
139
        foreach ($row as $columnName => $columnValue) {
140
            if ((!in_array($columnName, ['id', 'uid']) || isset($fieldsMatching[$columnName])) && !is_null($columnValue)) {
141
                $type = $fieldsMatching[$columnName]['type'];
142
                $value = $this->formatValueToBeans($type, $columnValue);
143
                $zohoBean->{$fieldsMatching[$columnName]['setter']}($value);
144
            }
145
        }
146
    }
147
148
    /**
149
     * Insert data to bean in order to update zoho records.
@@ 155-161 (lines=7) @@
152
     * @param type $columnName
153
     * @param type $valueDb
154
     */
155
    private function updateDataZohoBean(ZohoBeanInterface $zohoBean, array $fieldsMatching, $columnName, $valueDb){
156
        if (!in_array($columnName,['id','uid']) || (isset($fieldsMatching[$columnName]))) {
157
            $type = $fieldsMatching[$columnName]['type'];
158
            $value = is_null($valueDb)?$valueDb:$this->formatValueToBeans($type, $valueDb);
159
            $zohoBean->{$fieldsMatching[$columnName]['setter']}($value);
160
        }
161
    }
162
163
    /**
164
     * Change the value to the good format.