Code Duplication    Length = 3-12 lines in 2 locations

src/Ffcms/Core/Traits/ModelValidator.php 2 locations

@@ 205-207 (lines=3) @@
202
        $sources = $this->sources();
203
        $types = $this->types();
204
        // validate sources for current field
205
        if (Obj::isArray($sources) && array_key_exists($propertyName, $sources)) {
206
            $inputType = Str::lowerCase($sources[$propertyName]);
207
        }
208
        if (Obj::isArray($types)) {
209
            // check if field is array-nested element by dots and use first element as general
210
            $filterField = $propertyName;
@@ 208-219 (lines=12) @@
205
        if (Obj::isArray($sources) && array_key_exists($propertyName, $sources)) {
206
            $inputType = Str::lowerCase($sources[$propertyName]);
207
        }
208
        if (Obj::isArray($types)) {
209
            // check if field is array-nested element by dots and use first element as general
210
            $filterField = $propertyName;
211
            /** @todo - i have no idea why before i use only first element of dot-nested array. Probably bug.
212
            // check if field_name is dot-separated array and use general part
213
            if (Str::contains('.', $propertyName)) {
214
                $filterField = Str::firstIn($propertyName, '.');
215
            }*/
216
            if (array_key_exists($filterField, $types)) {
217
                $filterType = Str::lowerCase($types[$filterField]);
218
            }
219
        }
220
221
        // get clear field value
222
        $propertyValue = $this->getRequest($propertyName, $inputType);