Code Duplication    Length = 7-7 lines in 2 locations

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
    }

src/FieldFactory.php 1 location

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