Code Duplication    Length = 10-11 lines in 2 locations

src/Charcoal/Factory/AbstractFactory.php 2 locations

@@ 146-155 (lines=10) @@
143
        $exists = (class_exists($type) || interface_exists($type));
144
        if ($exists) {
145
            $classname = $type;
146
        } else {
147
            $classname = $this->resolve($type);
148
149
            $exists = (class_exists($classname) || interface_exists($classname));
150
            if (!$exists) {
151
                throw new InvalidArgumentException(
152
                    sprintf('Can not set "%s" as base class: Invalid class or interface name.', $classname)
153
                );
154
            }
155
        }
156
157
        $this->baseClass = $classname;
158
@@ 186-196 (lines=11) @@
183
            );
184
        }
185
186
        if (class_exists($type)) {
187
            $classname = $type;
188
        } else {
189
            $classname = $this->resolve($type);
190
191
            if (!class_exists($classname)) {
192
                throw new InvalidArgumentException(
193
                    sprintf('Can not set "%s" as defaut class: Invalid class name.', $classname)
194
                );
195
            }
196
        }
197
198
        $this->defaultClass = $classname;
199