Code Duplication    Length = 12-12 lines in 2 locations

src/RunOpenCode/AbstractBuilder/Ast/ClassMetadata.php 1 location

@@ 261-272 (lines=12) @@
258
            }
259
        }
260
261
        if ($traverse && $this->hasTraits()) {
262
263
            /**
264
             * @var TraitMetadata $trait
265
             */
266
            foreach ($this->traits as $trait) {
267
268
                if ($trait->hasPublicMethod($name, $traverse)) {
269
                    return $trait->getPublicMethod($name, $traverse);
270
                }
271
            }
272
        }
273
274
        if ($traverse && $this->hasParent() && $this->getParent()->hasPublicMethod($name, $traverse)) {
275
            return $this->getParent()->getPublicMethod($name, $traverse);

src/RunOpenCode/AbstractBuilder/Ast/TraitMetadata.php 1 location

@@ 180-191 (lines=12) @@
177
            }
178
        }
179
180
        if ($traverse && $this->hasTraits()) {
181
182
            /**
183
             * @var TraitMetadata $trait
184
             */
185
            foreach ($this->traits as $trait) {
186
187
                if ($trait->hasPublicMethod($name, $traverse)) {
188
                    return $trait->getPublicMethod($name, $traverse);
189
                }
190
            }
191
        }
192
193
        throw new RuntimeException(sprintf('Method "%s()" for trait "%s" does not exists.', $name, $this->fqcn));
194
    }