You are here

public static function TwigSanitize::arrayUnique in Twig Tools 8

Filters all non-unique values from an array.

Parameters

array $array: The array to remove non-unique values from.

Return value

array A new array with only unique values.

1 call to TwigSanitize::arrayUnique()
TwigSanitize::scrubClassArray in src/TwigExtension/TwigSanitize.php
Runs array through all of the Twig Tools sanitization filters.

File

src/TwigExtension/TwigSanitize.php, line 56

Class

TwigSanitize
Class TwigSanitize.

Namespace

Drupal\twig_tools\TwigExtension

Code

public static function arrayUnique(array $array) {
  return array_merge([], array_unique($array));
}