Code Duplication    Length = 7-7 lines in 2 locations

src/WebHemi/Form/Element/Web/RadioElement.php 1 location

@@ 66-72 (lines=7) @@
63
        $valuesToSelect = [];
64
65
        // Go through the given data and collect the selected ones.
66
        foreach ($value as $key => $data) {
67
            if ($isAssociativeArray && $data == 1) {
68
                $valuesToSelect[] = $key;
69
            } elseif (!$isAssociativeArray) {
70
                $valuesToSelect[] = $data;
71
            }
72
        }
73
74
        // Go through the options and change the defaults.
75
        foreach ($this->options as &$option) {

src/WebHemi/Form/Element/Web/SelectElement.php 1 location

@@ 79-85 (lines=7) @@
76
        $valuesToSelect = [];
77
78
        // Go through the given data and collect the selected ones.
79
        foreach ($value as $key => $data) {
80
            if ($isAssociativeArray && $data == 1) {
81
                $valuesToSelect[] = $key;
82
            } elseif (!$isAssociativeArray) {
83
                $valuesToSelect[] = $data;
84
            }
85
        }
86
87
        foreach ($this->options as $group => $options) {
88
            foreach ($options as $index => $option) {