Code Duplication    Length = 5-5 lines in 2 locations

src/Bridge/Symfony/VarDumper/Caster/EnumCaster.php 1 location

@@ 28-32 (lines=5) @@
25
        $r = new \ReflectionClass($enum);
26
        $constants = $r->getConstants();
27
28
        if (PHP_VERSION_ID >= 70100) {
29
            $constants = array_filter($constants, function (string $k) use ($r) {
30
                return $r->getReflectionConstant($k)->isPublic();
31
            }, ARRAY_FILTER_USE_KEY);
32
        }
33
34
        $rConstants = array_flip($constants);
35

src/AutoDiscoveredValuesTrait.php 1 location

@@ 64-68 (lines=5) @@
61
            $r = new \ReflectionClass($enumType);
62
            $values = $r->getConstants();
63
64
            if (PHP_VERSION_ID >= 70100) {
65
                $values = array_filter($values, function (string $k) use ($r) {
66
                    return $r->getReflectionConstant($k)->isPublic();
67
                }, ARRAY_FILTER_USE_KEY);
68
            }
69
70
            if (is_a($enumType, FlaggedEnum::class, true)) {
71
                $values = array_filter($values, function ($v) {