public static function remove($storage, $setting)
    {
        if (!is_array($storage) || empty($setting)) {
            throw new ArrayStorageException('Invalid parameters specified');
        }

        $setting = self::parseSetting($setting);

        if (empty($setting)) {
            throw new ArrayStorageException('Empty setting');
        }

        if (is_array($setting)) {
            return self::removeByIndex($storage, $setting);
        }
        if (!array_key_exists($setting, $storage)) {
            throw new ArrayStorageException(
                sprintf('setting "%s" does not exist in storage object', $setting)
            );
        }
        unset($storage[$setting]);
        return $storage;
    }