private function filterReflectors(array $reflectors) : array
    {
        $filteredReflectors = [];

        foreach ($reflectors as $index => $reflector) {
            if ($reflector->isPrivate()) {
                $filteredReflectors[] = $reflector;
                continue;
            }

            foreach ($reflectors as $index2 => $reflector2) {
                if ($index2 <= $index) {
                    continue;
                }

                if ($reflector->getName() === $reflector2->getName()) {
                    // overridden
                    continue 2;
                }
            }

            $filteredReflectors[] = $reflector;
        }

        return $filteredReflectors;
    }
private function filterReflectors(array $reflectors) : array
    {
        $filteredReflectors = [];

        foreach ($reflectors as $index => $reflector) {
            if ($reflector->isPrivate()) {
                $filteredReflectors[] = $reflector;
                continue;
            }

            foreach ($reflectors as $index2 => $reflector2) {
                if ($index2 <= $index) {
                    continue;
                }

                if ($reflector->getName() === $reflector2->getName()) {
                    // overridden
                    continue 2;
                }
            }

            $filteredReflectors[] = $reflector;
        }

        return $filteredReflectors;
    }
private function filterReflectors ( array $ reflectors ) : array { $ filteredReflectors = [ ] ; foreach ( $ reflectors as $ index => $ reflector ) { if ( $ reflector -> isPrivate ( ) ) { $ filteredReflectors [ ] = $ reflector ; continue ; } foreach ( $ reflectors as $ index2 => $ reflector2 ) { if ( $ index2 <= $ index ) { continue ; } if ( $ reflector -> getName ( ) === $ reflector2 -> getName ( ) ) { // overridden continue 2 ; } } $ filteredReflectors [ ] = $ reflector ; } return $ filteredReflectors ; }
Filters a list of ReflectionProperty or ReflectionMethod objects.

This method removes overridden properties, while keeping original order.

Note: ReflectionProperty and ReflectionObject do not explicitly share the same interface, but for the current
purpose they share the same set of methods, and as such are duck typed here.

@param \ReflectionProperty[]|\ReflectionMethod[] $reflectors

@return \ReflectionProperty[]|\ReflectionMethod[]
Filters a list of ReflectionProperty or ReflectionMethod objects .