Code Duplication    Length = 18-18 lines in 2 locations

src/Reflection/Parts/InterfaceTrait.php 1 location

@@ 43-60 (lines=18) @@
40
     *
41
     * @return ReflectionInterface[]
42
     */
43
    public function getSelfInterfaces()
44
    {
45
        $interfaces = [];
46
47
        if (!$this->getIndex() instanceof ReflectionsIndex) {
48
            return $interfaces;
49
        }
50
51
        foreach ($this->interfaces as $interface) {
52
            $interface = $this->getIndex()->getInterface($interface);
53
            if (!$interface instanceof ReflectionInterface) {
54
                continue;
55
            }
56
            $interfaces[$interface->getName()] = $interface;
57
        }
58
59
        return $interfaces;
60
    }
61
62
    /**
63
     * Gets the interfaces names, including inherited ones.

src/Reflection/Parts/TraitUseTrait.php 1 location

@@ 100-117 (lines=18) @@
97
     *
98
     * @return ReflectionTrait[]
99
     */
100
    public function getSelfTraits()
101
    {
102
        $traits = [];
103
104
        if (!$this->getIndex() instanceof ReflectionsIndex) {
105
            return $traits;
106
        }
107
108
        foreach ($this->traits as $trait) {
109
            $trait = $this->getIndex()->getTrait($trait);
110
            if (!$trait instanceof ReflectionTrait) {
111
                continue;
112
            }
113
            $traits[$trait->getName()] = $trait;
114
        }
115
116
        return $traits;
117
    }
118
119
    /**
120
     * Gets an array of properties defined in class traits, with inherited ones.