Code Duplication    Length = 10-11 lines in 2 locations

src/Charcoal/Factory/AbstractFactory.php 2 locations

@@ 228-237 (lines=10) @@
225
        $exists = (class_exists($type) || interface_exists($type));
226
        if ($exists) {
227
            $className = $type;
228
        } else {
229
            $className = $this->resolve($type);
230
231
            $exists = (class_exists($className) || interface_exists($className));
232
            if (!$exists) {
233
                throw new InvalidArgumentException(
234
                    sprintf('Can not set "%s" as base class: Invalid class or interface name.', $className)
235
                );
236
            }
237
        }
238
239
        $this->baseClass = $className;
240
@@ 268-278 (lines=11) @@
265
            );
266
        }
267
268
        if (class_exists($type)) {
269
            $className = $type;
270
        } else {
271
            $className = $this->resolve($type);
272
273
            if (!class_exists($className)) {
274
                throw new InvalidArgumentException(
275
                    sprintf('Can not set "%s" as defaut class: Invalid class name.', $className)
276
                );
277
            }
278
        }
279
280
        $this->defaultClass = $className;
281