Code Duplication    Length = 12-12 lines in 2 locations

Filter/Widget/Dynamic/DynamicAggregate.php 1 location

@@ 301-312 (lines=12) @@
298
     *
299
     * @return bool
300
     */
301
    protected function isChoiceActive($key, ViewData $data, $activeName)
302
    {
303
        if ($data->getState()->isActive()) {
304
            $value = $data->getState()->getValue();
305
306
            if (isset($value[$activeName]) && $key == $value[$activeName]) {
307
                return true;
308
            }
309
        }
310
311
        return false;
312
    }
313
314
    /**
315
     * Forms $unsortedChoices array with all possible choices.

Filter/Widget/Dynamic/MultiDynamicAggregate.php 1 location

@@ 116-127 (lines=12) @@
113
     *
114
     * @return bool
115
     */
116
    protected function isChoiceActive($key, ViewData $data, $activeName)
117
    {
118
        if ($data->getState()->isActive()) {
119
            $value = $data->getState()->getValue();
120
121
            if (isset($value[$activeName]) && in_array($key, $value[$activeName])) {
122
                return true;
123
            }
124
        }
125
126
        return false;
127
    }
128
129
    /**
130
     * @param array $terms