Code Duplication    Length = 7-10 lines in 2 locations

src/ZohoDatabasePusher.php 2 locations

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