protected function addNewTagsInChoices(array $choices, array $allChoices, array $values, $isGrouped)
    {
        foreach ($values as $value) {
            if (!\in_array($value, $allChoices)) {
                if ($isGrouped) {
                    $choices['-------'][$value] = $value;
                } else {
                    $choices[$value] = $value;
                }
            }
        }

        return $choices;
    }
protected function addNewTagsInChoices(array $choices, array $allChoices, array $values, $isGrouped)
    {
        foreach ($values as $value) {
            if (!\in_array($value, $allChoices)) {
                if ($isGrouped) {
                    $choices['-------'][$value] = $value;
                } else {
                    $choices[$value] = $value;
                }
            }
        }

        return $choices;
    }
protected function addNewTagsInChoices ( array $ choices , array $ allChoices , array $ values , $ isGrouped ) { foreach ( $ values as $ value ) { if ( ! \ in_array ( $ value , $ allChoices ) ) { if ( $ isGrouped ) { $ choices [ '-------' ] [ $ value ] = $ value ; } else { $ choices [ $ value ] = $ value ; } } } return $ choices ; }
Add new tags in choices.

@param array    $choices    The choices
@param array    $allChoices The all choices
@param string[] $values     The values
@param bool     $isGrouped  Check if the choices is grouped

@return array The choice with new tags
Add new tags in choices .