Code Duplication    Length = 12-12 lines in 2 locations

src/RunOpenCode/AbstractBuilder/Ast/Metadata/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/Metadata/TraitMetadata.php 1 location

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