src/Contao/View/Contao2BackendView/ActionHandler/SelectHandler.php
private function getUniqueValueFromArray(array $values)
    {
        $serializedValues = false;
        foreach ($values as $key => $value) {
            if (!\is_array($value)) {
                continue;
            }

            $values[$key] = \serialize($value);

            $serializedValues = true;
        }

        if (!$serializedValues) {
            return 1 === \count(\array_unique($values)) ? $values[0] : null;
        }

        return 1 === \count(\array_unique($values)) ? \unserialize($values[0], ['allowed_classes' => true]) : null;
    }
private function getUniqueValueFromArray(array $values)
    {
        $serializedValues = false;
        foreach ($values as $key => $value) {
            if (!\is_array($value)) {
                continue;
            }

            $values[$key] = \serialize($value);

            $serializedValues = true;
        }

        if (!$serializedValues) {
            return 1 === \count(\array_unique($values)) ? $values[0] : null;
        }

        return 1 === \count(\array_unique($values)) ? \unserialize($values[0], ['allowed_classes' => true]) : null;
    }
private function getUniqueValueFromArray ( array $ values ) { $ serializedValues = false ; foreach ( $ values as $ key => $ value ) { if ( ! \ is_array ( $ value ) ) { continue ; } $ values [ $ key ] = \ serialize ( $ value ) ; $ serializedValues = true ; } if ( ! $ serializedValues ) { return 1 === \ count ( \ array_unique ( $ values ) ) ? $ values [ 0 ] : null ; } return 1 === \ count ( \ array_unique ( $ values ) ) ? \ unserialize ( $ values [ 0 ] , [ 'allowed_classes' => true ] ) : null ; }
Get the unique value from a array. The value will return if the all values in the array the same.

@param array $values The values.

@return string|array|null
Get the unique value from a array . The value will return if the all values in the array the same .