@param ArrayAccess|array $array
@param array|string      $keys

@return void
3309
public static function remove(&$array, $keys)
    {
        $original = &$array;
        $keys     = (array) $keys;

        if (!Arr::accessible($array)) {
            return;
        }
        if (count($keys) === 0) {
            return;
        }

        foreach ($keys as $key) {
            if (Arr::exists($array, $key)) {
                unset($array[$key]);

                continue;
            }

            // Clean up before each pass
            $array = &$original;
            $parts = explode('.', $key);

            while (count($parts) > 1) {
                $part = array_shift($parts);
                if (isset($array[$part]) && is_array($array[$part])) {
                    $array = &$array[$part];
                } else {
                    continue 2;
                }
            }

            unset($array[array_shift($parts)]);
        }
    }
157698
public static function filterKeys ($array, $keys)
		{
			if (is_array($array))
			{
				$return = [];
				if (!is_array($keys))
					$keys = [ $keys ];
				foreach ($keys as $key)
					if (isset($array[ $key ]))
						$return[ $key ] = $array[ $key ];

				return $return;
			}

			return null;
		}
1007715
public static function removeKeys($array, $keys)
    {
        // Loop over the array
        foreach ($array as $key => $value) {
            // Check if we want to remove it...
            if (!is_numeric($key) and in_array($key, $keys)) {
                unset($array[$key]);
                continue;
            }

            // Filter the value if it's an array also
            $array[$key] = is_array($value) ? static::removeKeys($value, $keys) : $value;
        }

        return $array;
    }
1190238
private function validateKeys(array $keys)
    {
        foreach (['block_id', 'page_id', 'manager', 'updated_at'] as $key) {
            if (!isset($keys[$key])) {
                throw new \RuntimeException(sprintf('Please define a `%s` key, provided: %s', $key, json_encode(array_keys($keys))));
            }
        }
    }
202041
public function copyToArray(array &$array)
    {
        parent::copyToArray($array);

        $array['action']       = LanguageUtility::toString($this->action);
        $array['grantType']    = LanguageUtility::toString($this->grantType);
        $array['clientId']     = $this->clientId;
        $array['subject']      = $this->subject;
        $array['scopes']       = $this->scopes;
        $array['accessToken']  = $this->accessToken;
        $array['tokenType']    = $this->tokenType;
        $array['expiresIn']    = LanguageUtility::orZero($this->expiresIn);
        $array['expiresAt']    = LanguageUtility::orZero($this->expiresAt);
        $array['refreshToken'] = $this->refreshToken;
        $array['properties']   = LanguageUtility::convertArrayOfArrayCopyableToArray($this->properties);
    }
539086
public function addIndex(array $keys, array $options = []) : void
    {
        $this->indexes[] = [
            'keys' => array_map(static function ($value) {
                if ($value === 1 || $value === -1) {
                    return $value;
                }
                if (is_string($value)) {
                    $lower = strtolower($value);
                    if ($lower === 'asc') {
                        return 1;
                    }

                    if ($lower === 'desc') {
                        return -1;
                    }
                }
                return $value;
            }, $keys),
            'options' => $options,
        ];
    }
1241702
private function cloneArray(array &$array): void
    {
        foreach ($array as $key => $value) {
            if (is_object($value)) {
                $array[$key] = clone $value;
            }
            if (is_array($value)) {
                $this->cloneArray($array[$key]);
            }
        }
    }
574720
protected function fixEmptyRelationArrays(array &$array)
    {
        $activeKey = '';
        if (array_key_exists('rlt', $array)) {
            $activeKey = 'rlt';
        }
        if (array_key_exists('relations', $array)) {
            $activeKey = 'relations';
        }

        if (! $activeKey) {
            return;
        }

        $relations = $array[$activeKey];

        if ($relations) {
            foreach ($relations as $name => $jory) {
                if (empty($jory)) {
                    $array[$activeKey][$name] = new \stdClass();
                } else {
                    $this->fixEmptyRelationArrays($jory);
                }
            }
        }
    }
1060825
public static function removeKeys($array, $removeKeys)
    {
        $result = [];
        if (!is_array($removeKeys)) {
            $removeKeys = [$removeKeys];
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = self::removeKeys($value, $removeKeys);
            }
            if (in_array($key, $removeKeys)) {
                continue;
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
389717
public static function destroy(array $keys = [])
    {
        if (empty($keys))
        {
            session_destroy();
        }
        else
        {
            foreach ($keys as $key) {
                if (static::_isSet($key))
                {
                    unset($_SESSION[$key]);
                }
            }
        }
    }
125344
public static function only($array, $keys)
    {
        $imploded = static::implode($array);
        $only     = Arr::only($imploded, $keys);
        return static::explode($only);
    }
326821
public static function getSubArrayFromArrayByKeys(array $array, array $keys)
    {
        $result = [];

        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $result[$key] = $array[$key];
            }
        }

        return $result;
    }
1024270
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // newClientSecret
        $this->setNewClientSecret(
            LanguageUtility::getFromArray('newClientSecret', $array));

        // oldClientSecret
        $this->setOldClientSecret(
            LanguageUtility::getFromArray('oldClientSecret', $array));
    }
962591
public static function forget(&$array, $keys) {
        $original = &$array;

        $keys = (array) $keys;

        if (count($keys) === 0) {
            return;
        }

        foreach ($keys as $key) {
            // if the exact key exists in the top-level, remove it
            if (array_key_exists($key, $array)) {
                unset($array[$key]);
                continue;
            }

            $parts = explode('.', $key);

            // clean up before each pass
            $array = &$original;

            while (count($parts) > 1) {
                $part = array_shift($parts);

                if (isset($array[$part]) && is_array($array[$part])) {
                    $array = &$array[$part];
                } else {
                    continue 2;
                }
            }

            unset($array[array_shift($parts)]);
        }
    }
432221
public static function pop(array $array, $key)
    {
        $keys = explode('.', $key);
        foreach($keys as $key) {
            if(!isset($array[$key])) {
                return null;
            }
            $array = $array[$key];
        }

        if(!is_array($array)) {
            return null;
        }

        return array_pop($array);
    }
485416
public function onPostImageDataLoad(&$data, array $keys)
    {
        foreach ($keys as $key) {
            if (isset($data[$key])) {
                $data[$key] = wei()->cdn->convertToRealUrl($data[$key]);
            }
        }
    }
1332096
public static function get(array $array, ...$keys)
    {
        $key = array_shift($keys);

        if (!isset($array[$key])) {
            return null;
        }

        if (empty($keys)) {
            return $array[$key] ?? null;
        }

        if (!\is_array($array[$key])) {
            return null;
        }

        return self::get($array[$key], ...$keys);
    }