Code Duplication    Length = 10-11 lines in 2 locations

src/Charcoal/Factory/AbstractFactory.php 2 locations

@@ 138-147 (lines=10) @@
135
        $exists = (class_exists($type) || interface_exists($type));
136
        if ($exists) {
137
            $classname = $type;
138
        } else {
139
            $classname = $this->resolve($type);
140
141
            $exists = (class_exists($classname) || interface_exists($classname));
142
            if (!$exists) {
143
                throw new InvalidArgumentException(
144
                    sprintf('Can not set "%s" as base class: Invalid class or interface name.', $classname)
145
                );
146
            }
147
        }
148
149
        $this->baseClass = $classname;
150
@@ 178-188 (lines=11) @@
175
            );
176
        }
177
178
        if (class_exists($type)) {
179
            $classname = $type;
180
        } else {
181
            $classname = $this->resolve($type);
182
183
            if (!class_exists($classname)) {
184
                throw new InvalidArgumentException(
185
                    sprintf('Can not set "%s" as defaut class: Invalid class name.', $classname)
186
                );
187
            }
188
        }
189
190
        $this->defaultClass = $classname;
191