Returns a string of the install URL for the app
@param array $data
@return string
341131
public function installURL($data = array())
	{
		// https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}
		return 'https://' . $this->_API['SHOP_DOMAIN'] . '/admin/oauth/authorize?client_id=' . $this->_API['API_KEY'] . '&scope=' . implode(',', $data['permissions']) . (!empty($data['redirect']) ? '&redirect_uri=' . urlencode($data['redirect']) : '');
	}
421134
protected function toUrlArray($data)
    {
        $url = array_intersect_key($data, $this->uriKeys);

        foreach (['host', 'user', 'pass'] as $key) {
            if (!isset($url[$key])) {
                continue;
            }

            $url[$key] = urlencode($url[$key]);
        }

        if ($url['adapter']) {
            $return = $url['scheme'] . '+' . $url['adapter'] . '://';
        } else {
            $return = $url['scheme'] . '://';
        }

        if (!empty($url['user'])) {
            $return .= $url['user'];
            if (!empty($url['pass'])) {
                $return .= ':' . $url['pass'];
            }
            $return .= '@';
        }

        $return .= $url['host'];

        $defaultPort = $this->defaultPort();
        if (!empty($url['port']) && $url['port'] != $defaultPort) {
            $return .= ':' . $url['port'];
        }
        $return .= $url['path'];

        $query = array_diff_key($data, $this->uriKeys);
        if ($query) {
            foreach ($query as $key => &$value) {
                if (is_array($value)) {
                    $intermediate = [];
                    foreach ($value as $k => $v) {
                        $v = urlencode($v);
                        $intermediate[] = "{$key}[$k]=$v";
                    }
                    $value = implode($intermediate, '&');

                    continue;
                }
                $value = "$key=$value";
            }
            $return .= '?' . implode($query, '&');
        }

        return $return;
    }
499533
private function generateImageLine(array $data): string
    {
        $images = '';

        if (\count($data['images']) > 1000) {
            $data['images'] = array_splice($data['images'], 1000);
        }

        $builder = [
            'url' => 'loc',
            'location' => 'geo_location',
        ];

        foreach ($data['images'] as $image) {
            $images .= '<image:image>';

            foreach ($image as $key => $element) {
                $images .= sprintf('<image:%1$s>%2$s</image:%1$s>', ($builder[$key] ?? $key), $element);
            }

            $images .= '</image:image>';
        }

        return sprintf('    '.'<url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
    }
270817
private function unparseUrl($data)
    {
        $scheme = isset($data['scheme']) ? $data['scheme'] . '://' : '';
        $host = isset($data['host']) ? $data['host'] : '';
        $port = isset($data['port']) ? ':' . $data['port'] : '';
        $user = isset($data['user']) ? $data['user'] : '';
        $pass = isset($data['pass']) ? ':' . $data['pass'] : '';
        $pass = ($user || $pass) ? "$pass@" : '';
        $path = isset($data['path']) ? $data['path'] : '';
        $query = isset($data['query']) ? '?' . $data['query'] : '';
        $fragment = isset($data['fragment']) ? '#' . $data['fragment'] : '';

        return "$scheme$user$pass$host$port$path$query$fragment";
    }
1371219
public static function decrypt($data) : string {
      $crypter = new Crypter();

      return $crypter->decrypt($data, self::getAppKey());
    }
939318
protected function formatMpMessage(array $data = [])
    {
        $params = $this->baseFormat($data, $this->mpMessage);

        if (empty($params['miniprogram']['appid'])) {
            $params['miniprogram']['appid'] = $this->app['config']['app_id'];
        }

        $params['data'] = $this->formatData($params['data'] ?? []);

        return $params;
    }
932134
public function format(array $data)
    {
        $value = parent::format($data);
        foreach ($this->list as $uri => $values) {
            if (in_array($value, $values)) {
                return $uri;
            }
        }
        return '';
    }
467767
public function createRequestData(array $data)
    {
        $data = $this
            ->getRequestOptionsResolver()
            ->resolve(array_replace($data, [
                'vads_page_action' => 'PAYMENT',
                'vads_version'     => 'V2',
            ]));

        $data = array_filter($data, function ($value) {
            return null !== $value;
        });

        $data['vads_site_id'] = $this->config['site_id'];
        $data['vads_ctx_mode'] = $this->config['ctx_mode'];

        $data['signature'] = $this->generateSignature($data);

        return $data;
    }
1338893
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $uidOfStyleguideRootPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide');
        $uidOfElementsBasicPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide_elements_basic');
        $uidOfElementsGroupPage = $recordFinder->findPidOfMainTableRecord('tx_styleguide_elements_group');
        $result = [];
        // Don't add first page if not selectable
        if (!isset($data['fieldConfig']['config']['treeConfig']['appearance']['nonSelectableLevels'])) {
            $result[] = $uidOfStyleguideRootPage;
        }
        // Don't add sub pages if maxlevels is set
        if (!isset($data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'])
            || (isset($data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'])
                && $data['fieldConfig']['config']['treeConfig']['appearance']['maxLevels'] > 1)
        ) {
            $result[] = $uidOfElementsBasicPage;
            $result[] = $uidOfElementsGroupPage;
        }
        return implode(',', $result);
    }
520522
public static function toComment(array $data): string
    {
        $result = [];
        foreach ($data as $key => $value) {
            $result[] = $key . ': ' . $value . ';';
        }

        return implode(PHP_EOL, $result);
    }
105379
private static function wringer($data)
    {
        if (is_object($data)) {
            if ($data instanceof \BootPress\Blog\Twig\Object) {
                $data = $data->properties + $data->methods;
            } elseif ($data instanceof \BootPress\Blog\Twig\Page) {
                $data = $data->html + $data->methods;
            } else {
                $data = get_class($data).' Object';
            }
        }
        if (is_array($data)) {
            $cloner = array();
            foreach ($data as $key => $value) {
                $cloner[$key] = self::wringer($value);
            }

            return $cloner;
        }
        if (is_string($data)) {
            $data = str_replace(array("\r", "\n", "\t"), array('\\r', '\\n', '\\t'), $data);
        }

        return $data;
    }
559589
public static function encodeData($data)
    {
        if (\is_array($data)) {
            foreach ($data as $key => $value) {
                $data[$key] = \urlencode($value);
            }

            return $data;
        }

        return \urlencode($data);
    }
120393
public function link_provider(array $data)
	{
		// do some validation
		if ( ! is_numeric($data['expires']))
		{
			if ($date = \DateTime::createFromFormat(\DateTime::ISO8601, $data['expires']))
			{
				$data['expires'] = $date->getTimestamp();
			}
			elseif ($date = \DateTime::createFromFormat('Y-m-d H:i:s', $data['expires']))
			{
				$data['expires'] = $date->getTimestamp();
			}
			else
			{
				$data['expires'] = time();
			}
		}

		// get rid of old registrations to prevent duplicates
		\DB::delete($this->config['table'])->where('uid', '=', $data['uid'])->where('provider', '=', $data['provider'])->execute(static::$db_connection);

		// insert the new provider UID
		list($insert_id, $rows_affected) = \DB::insert($this->config['table'])->set($data)->execute(static::$db_connection);
		return $rows_affected ? $insert_id : false;
	}
781101
protected function getVcsRepositoryUrl(array $data, $registryName = null)
    {
        if (!isset($data['repository']['url'])) {
            $msg = sprintf('The "repository.url" parameter of "%s" %s asset package must be present for create a VCS Repository', $registryName, $this->assetType->getName());
            $msg .= PHP_EOL.'If the config comes from the Bower Private Registry, override the config with a custom Asset VCS Repository';
            $ex = new InvalidCreateRepositoryException($msg);
            $ex->setData($data);

            throw $ex;
        }

        return (string) $data['repository']['url'];
    }
1195701
private function replace(array $data): string
    {
        $widget = explode(':', $data[1]);
        if (class_exists($class = $widget[0]) && method_exists($class, $method = $widget[1])) {
            return call_user_func([$class, $method]);
        }

        return '';
    }
907691
public static function decodeUrlSafe($data) {
		$data = \strtr(
			$data,
			self::LAST_THREE_URL_SAFE,
			self::LAST_THREE_STANDARD
		);

		return self::decode($data);
	}
1285211
public function search(array $data)
    {
        $path = str_replace('#NAME#', urlencode($data['name']), self::SEARH_URL);
        $path = str_replace('#LIMIT#', self::DEFAULT_LIMIT, $path);
        $path = str_replace('#GENRE#', (isset($data['genre']) ? $data['genre'] : ''), $path);
        $path = str_replace('#TYPE#', (isset($data['type']) ? $data['type'] : ''), $path);
        $path = str_replace('#SEASON#', (isset($data['season']) ? str_replace('-', '_', $data['season']) : ''), $path);
        $body = (array) $this->browser->get($path);

        // build list
        foreach ($body as $key => $item) {
            // set a name based on the locale
            if ($this->locale == 'ru' && $item['russian']) {
                $name = $item['russian'];
                $description = $item['name'];
            } else {
                $name = $item['name'];
                $description = $item['russian'];
            }

            $body[$key] = new ItemSearch(
                $name,
                $this->getLinkForFill($this->browser->getHost().$item['url']),
                $this->browser->getHost().$item['image']['original'],
                $description,
                $this->browser->getHost().$item['url']
            );
        }

        return $body;
    }