src/Helpers/ArrayHelper.php
protected static function applyArrayFilter($array, $filter, array &$result, array &$forbiddenVars) {
        $keys = explode('.', $filter);
        $globalKey = $keys[0];
        $localKey = isset($keys[1]) ? $keys[1] : null;

        if ($globalKey[0] === '!') {
            $forbiddenVars[] = [
                substr($globalKey, 1),
                $localKey,
            ];
            return;
        }

        if (!array_key_exists($globalKey, $array)) {
            return;
        }
        if ($localKey === null) {
            $result[$globalKey] = $array[$globalKey];
            return;
        }
        if (!isset($array[$globalKey][$localKey])) {
            return;
        }
        if (!array_key_exists($globalKey, $result)) {
            $result[$globalKey] = [];
        }
        $result[$globalKey][$localKey] = $array[$globalKey][$localKey];
    }
protected static function applyArrayFilter($array, $filter, array &$result, array &$forbiddenVars) {
        $keys = explode('.', $filter);
        $globalKey = $keys[0];
        $localKey = isset($keys[1]) ? $keys[1] : null;

        if ($globalKey[0] === '!') {
            $forbiddenVars[] = [
                substr($globalKey, 1),
                $localKey,
            ];
            return;
        }

        if (!array_key_exists($globalKey, $array)) {
            return;
        }
        if ($localKey === null) {
            $result[$globalKey] = $array[$globalKey];
            return;
        }
        if (!isset($array[$globalKey][$localKey])) {
            return;
        }
        if (!array_key_exists($globalKey, $result)) {
            $result[$globalKey] = [];
        }
        $result[$globalKey][$localKey] = $array[$globalKey][$localKey];
    }
Helper method for ArrayHelper::filter()
@param array $array
@param string $filter
@param array $result
@param array $forbiddenVars
@internal