Code Duplication    Length = 5-5 lines in 2 locations

src/AutoDiscoveredValuesTrait.php 1 location

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

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