Code Duplication    Length = 7-7 lines in 2 locations

src/FieldFactory.php 1 location

@@ 114-120 (lines=7) @@
111
112
        $className = $this->getClassName($name, $scheme[$name]['type']) ?: $this->defaultType;
113
114
        foreach ($this->namespaces as $namespace) {
115
            $class = $namespace.$className;
116
117
            if (class_exists($class)) {
118
                return new $class($table, $name);
119
            }
120
        }
121
122
        throw new SimpleCrudException("No field class found for '{$name}'");
123
    }

src/QueryFactory.php 1 location

@@ 35-41 (lines=7) @@
32
    {
33
        $name = ucfirst($name);
34
35
        foreach ($this->namespaces as $namespace) {
36
            $class = $namespace.$name;
37
38
            if (class_exists($class)) {
39
                return new $class($table);
40
            }
41
        }
42
43
        throw new SimpleCrudException("Query '{$name}' not found");
44
    }