Filter array response.

@param array $array
@return array
977839
protected function filter(array $array)
    {
        $config = collect(array_dot($array))->map(function ($value, $key) {
            if (str_contains($key, $this->hidden)) {
                return '';
            }

            if (in_array($key, $this->boolean)) {
                return (bool) $value;
            }

            return $value;
        });

        $array = [];
        foreach ($config as $key => $value) {
            array_set($array, $key, $value);
        }

        return $array;
    }
351467
public static function removeEmptyElementsRecursively(array $array): array
    {
        $result = $array;
        foreach ($result as $key => $value) {
            if (is_array($value)) {
                $result[$key] = self::removeEmptyElementsRecursively($value);
                if ($result[$key] === []) {
                    unset($result[$key]);
                }
            } elseif ($value === null) {
                unset($result[$key]);
            }
        }
        return $result;
    }
1355221
protected function filter(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            if ($value['inactive']) {
                continue;
            }

            $result[$key] = $value;
            if (isset($value['children'])) {
                $result[$key]['children'] = $this->filter($value['children']);
            }
        }

        return $result;
    }
454314
protected function isPureArray(array $array ) {
            $i=0;
            foreach($array as $k=>$v) {
                if ( $k !== $i ) {
                   return false;
                }
                $i++;
            }

            return true;
        }
527191
public static function array_filter_keys($array, $params = null)
    {

        $array = self::toArray($array);

        $isMultidimensionnal = self::is_multi($array);

        if (is_string($params)) {
            $params = array('with' => $params);
        }

        if (isset($params['with'])) {
            $data = array();

            if (!$isMultidimensionnal) {
                foreach ($array as $key => $value) {
                    if (preg_match('/' . $params['with'] . '/i', $key)) {
                        $data[] = $value;
                    }
                }
            } else {
                foreach ($array as $v1) {
                    foreach ($v1 as $key => $value) {
                        if (preg_match('/' . $params['with'] . '/i', $key)) {
                            $data[] = $value;
                        }
                    }
                }
            }

            return $data;
        }

        return array_filter($array);

    }
423995
public static function array_pick($array) {
    if (!is_array( $array )) {
      return $array;
    }
    $keys = array_slice(func_get_args(), 1);
    $keys = self::array_flatten($keys);
    $pick = array();
    foreach ( $keys as $key ) {
      if (!array_key_exists($key, $array)) {
        continue;
      }
      $pick[$key] = $array[$key];
    }
    return $pick;
  }
62579
private
    static function objectify(
        array $array
    ) {
        foreach ($array as &$item) {
            if (is_array($item)) {
                $item = self::objectify($item);
            }
        }

        return (object)$array;
    }
1269565
public static function cleanupArray($array)
    {
        $newArray = [];

        $array = static::toArray($array);

        foreach ($array as $key => $val) {

            if (is_array($val)) {
                $val = static::cleanupArray($val);
            } else {
                $val = trim($val);
                if (!$val) {
                    continue;
                }
            }

            $newArray[$key] = $val;
        }

        return $newArray;
    }
1348608
public function filterArray($array)
    {
        $newArray = array();

        foreach ($array as $key => $row) {
            foreach ($this->columnToFilter as $column) {
                if (!array_key_exists($column, $row)) {
                    continue;
                }

                if (self::match($this->patternToSearchQuoted, $row[$column], $this->invertedMatch)) {
                    $newArray[$key] = $row;
                    continue 2;
                }
            }
        }

        return $newArray;
    }
80310
public static function arrayToMask($array)
    {
        $mask = self::NONE_MASK;

        if (empty($array) || !is_array($array)) {
            return $mask;
        }

        foreach ($array as $verb) {
            switch ($verb) {
                case self::GET:
                    $mask |= self::GET_MASK;
                    break;
                case self::POST:
                    $mask |= self::POST_MASK;
                    break;
                case self::PUT:
                    $mask |= self::PUT_MASK;
                    break;
                case self::PATCH:
                    $mask |= self::PATCH_MASK;
                    break;
                case self::DELETE:
                    $mask |= self::DELETE_MASK;
                    break;
                case self::OPTIONS:
                    $mask |= self::OPTIONS_MASK;
                    break;
                case self::HEAD:
                    $mask |= self::HEAD_MASK;
                    break;
                case self::COPY:
                    $mask |= self::COPY_MASK;
                    break;
                case self::TRACE:
                    $mask |= self::TRACE_MASK;
                    break;
                case self::CONNECT:
                    $mask |= self::CONNECT_MASK;
                    break;
            }
        }

        return $mask;
    }
866770
private function filterDuplicates($array)
    {
        $result = [];
        foreach ($array as $value) {
            if (!in_array($value, $result)) {
                $result[] = $value;
            }
        }
        return array_filter($result);
    }
1040289
private function phpEncodeArray(array $array)
    {
        $isPlainArray = function (array $value) {
            return ((count($value) === 0)
                || (
                    (array_keys($value) === range(0, count($value) - 1))
                    && (0 === count(array_filter(array_keys($value), 'is_string'))))
            );
        };

        if ($isPlainArray($array)) {
            return '['.implode(', ', array_map([$this, 'phpEncodeValue'], $array)).']';
        }

        return '['.implode(', ', array_map(function ($key) use ($array) {
            return $this->phpEncodeValue($key).' => '.$this->phpEncodeValue($array[$key]);
        }, array_keys($array))).']';
    }
950828
public function doReAuthorization(array $array)
    {
        $WSRequest = array(
            'transactionID'   => $array['transactionID'],
            'payment'         => $this->payment($array['payment']),
            'order'           => $this->order($array['order']),
            'privateDataList' => $this->privateData
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doReAuthorization');
    }
620830
public function query($array)
	{
		$array['action'] = 'query';
		$array['format'] = 'php';

		$apiResult = $this->session->get($this->api.'?'.http_build_query($array));

		return unserialize($apiResult->body);
	}
8227
public function filter(array $items): array
    {
        foreach ($this->filter as $filter) {
            $items = $filter->filter($items);
        }

        return $items;
    }
475674
protected function filterAssetArray($array, $type = null)
    {
        $types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
        $typeIndex = array_search(strtolower($type), $types);
        return $typeIndex !== false ? $array[$typeIndex] : $array;
    }
1324609
public static function filter(array $array = [], Closure $closure = null): array
    {
        if ($closure) {
            $result = [];

            foreach ($array as $key => $value) {
                if (call_user_func($closure, $value)) {
                    $result[] = $value;
                }
            }

            return $result;
        }

        return __::compact($array);
    }