Code Duplication    Length = 10-11 lines in 2 locations

src/Charcoal/Factory/AbstractFactory.php 2 locations

@@ 328-337 (lines=10) @@
325
        $exists = (class_exists($type) || interface_exists($type));
326
        if ($exists) {
327
            $classname = $type;
328
        } else {
329
            $classname = $this->resolve($type);
330
331
            $exists = (class_exists($classname) || interface_exists($classname));
332
            if (!$exists) {
333
                throw new InvalidArgumentException(
334
                    sprintf('Can not set "%s" as base class: Invalid class or interface name.', $classname)
335
                );
336
            }
337
        }
338
339
        $this->baseClass = $classname;
340
@@ 368-378 (lines=11) @@
365
            );
366
        }
367
368
        if (class_exists($type)) {
369
            $classname = $type;
370
        } else {
371
            $classname = $this->resolve($type);
372
373
            if (!class_exists($classname)) {
374
                throw new InvalidArgumentException(
375
                    sprintf('Can not set "%s" as defaut class: Invalid class name.', $classname)
376
                );
377
            }
378
        }
379
380
        $this->defaultClass = $classname;
381