Copy endpoint data for other prefixes used by a given service

@param $data
@param $prefixData
@return array
505275
public static function mergePrefixData($data, $prefixData)
    {
        $prefixGroups = $prefixData['prefix-groups'];

        foreach ($data["partitions"] as $index => $partition) {
            foreach ($prefixGroups as $current => $old) {
                $serviceData = Env::search("services.{$current}", $partition);
                if (!empty($serviceData)) {
                    foreach ($old as $prefix) {
                        if (empty(Env::search("services.{$prefix}", $partition))) {
                            $data["partitions"][$index]["services"][$prefix] = $serviceData;
                        }
                    }
                }
            }
        }

        return $data;
    }
1362656
protected function mergeMethods($nodeData)/*# : array */
    {
        // no merge
        if (empty($nodeData) || isset($nodeData[0])) {
            return (array) $nodeData;
        }

        // in sections
        $result = [];
        foreach ($nodeData as $data) {
            $result = array_merge($result, $data);
        }
        return $result;
    }
83608
public function takeData($data)
    {
        $keyColumn = $this->getKeyColumn();
        if (array_key_exists($keyColumn, $data) && is_array($data[$keyColumn])) {
            foreach ($data[$keyColumn] as $recPos => $recordKey) {
                if (substr($recordKey, 0, 4) == 'ext:') {
                    $data['external-ids'][] = $recordKey;
                    unset($data[$keyColumn][$recPos]);
                }
            }
            if (count($data[$keyColumn]) == 1) {
                $data[$keyColumn] = current($data[$keyColumn]);
            }
        }
        $result = parent::takeData($data);

        if (array_key_exists($keyColumn, $data) || array_key_exists('kod', $data)) {
            $this->updateApiURL();
        }

        return $result;
    }
887312
protected function transformUseVariables($data)
    {
        foreach ($data as $key => $value) {
            $data[$key] = $this->getSerializedPropertyValue($value);
        }

        return $data;
    }
330609
public static function getRouterParametersFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_ROUTER_PARAMS, $data));
        $result = $data[self::KEY_ROUTER_PARAMS];
        assert(empty($result) === false);

        return $result;
    }
1367623
private function createArrayLines(array $data, $prefix = '')
    {
        $content = '';

        foreach ($data as $key => $value) {
            $newKey = "{$prefix}[$key]";

            if (is_array($value)) {
                $content .= $this->createArrayLines($value, $newKey);
                continue;
            }

            $content .= $this->createPropertyLine($newKey, $value);
        }

        return $content;
    }
1145174
private function normalizeLocationData(LocationData $locationData)
    {
        return [
            'id' => $locationData->getId(),
            'name' => $locationData->getName(),
            'code' => $locationData->getCode(),
            'type' => $locationData->getType(),
        ];
    }
196328
public function prepareData($data = [])
    {
        return (array) ($this->data instanceof Closure ? call_user_func($this->data, $this, $data) : $this->data);
    }
1021684
public function _flush($data)
    {
        if ($this->_cancel) {
            return $data;
        }
        $contentType = null;
        $storedHeaders = array();
        $headersList = headers_list();
        foreach($this->_specificOptions['memorize_headers'] as $key=>$headerName) {
            foreach ($headersList as $headerSent) {
                $tmp = explode(':', $headerSent);
                $headerSentName = trim(array_shift($tmp));
                if (strtolower($headerName) == strtolower($headerSentName)) {
                    $headerSentValue = trim(implode(':', $tmp));
                    $storedHeaders[] = array($headerSentName, $headerSentValue);
                }
            }
        }
        $array = array(
            'data' => $data,
            'headers' => $storedHeaders
        );
        $this->save($array, null, $this->_activeOptions['tags'], $this->_activeOptions['specific_lifetime'], $this->_activeOptions['priority']);
        return $data;
    }
468316
protected function request_proxy_data($data)
    {
        if (isset($this->params['rescued'])) {
            return $data;
        }

        $data['$proxy'] = array(
            'client' => isset($this->params['route']['client'])
                ? $this->params['route']['client']
                : $this->params['client_id'],
            'host' => $this->params['host'],
            'port' => $this->params['port']
        );
        if (is_array($this->params['proxy'])) {
            $this->server->options['clear'] = isset($this->params['proxy']['clear'])
                ? $this->params['proxy']['clear'] : false;
            $this->server->options['host'] = isset($this->params['proxy']['host'])
                ? $this->params['proxy']['host'] : $this->params['host'];
            $this->server->options['port'] = isset($this->params['proxy']['port'])
                ? $this->params['proxy']['port'] : $this->params['port'];
        }

        return $data;
    }
38501
protected function getFromCache($url, array $data, $endpoint)
	{
		$key = $endpoint . $url;
		$key .= http_build_query($data);
		$key = sha1($key);

		return $this->mc->get('jira:cache:' . $key);
	}
1148841
public static function prettyPrint($data, $prefix = '')
    {
        $php = '[' . PHP_EOL;
        if (is_array($data) and array_diff_key($data, array_keys(array_keys($data)))) {
            foreach ($data as $key => $value) {
                $php .= $prefix . '  ' . var_export($key, true) . ' => ';
                if (is_array($value)) {
                    $php .= self::prettyPrint($value, $prefix . '  ');
                } else {
                    $php .= var_export($value, true);
                }
                $php .= ',' . PHP_EOL;
            }
        } else {
            foreach ($data as $value) {
                $php .= $prefix . '  ';
                if (is_array($value)) {
                    $php .= self::prettyPrint($value, $prefix . '  ');
                } else {
                    $php .= var_export($value, true);
                }
                $php .= ',' . PHP_EOL;
            }
        }
        return $php . $prefix . ']';
    }
34629
public static function getRoutesDataFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_ROUTES_DATA, $data));
        $result = $data[self::KEY_ROUTES_DATA];

        return $result;
    }
770459
public static function create_endpoint($data) {
        require_capability('moodle/site:config', context_system::instance());
        $endpoint = new endpoint(0, $data);

        // Will throw exceptions on validation failures.
        $endpoint->create();
        return $endpoint;
    }
698532
public function withValues($data)
    {
        $copy = $this->values;
        foreach ($data as $key => $value) {
            $copy[$key] = $value;
        }
        return new Context($copy);
    }
849699
public function extra(array $data, $prefix = '')
    {
        $this->initInternals();

        return $this->blueprintSchema->extra($data, $prefix);
    }
733586
protected function getData($data)
    {
        $method = "load" . strtoupper($this->mode);

        libxml_use_internal_errors(true);
        $this->dom->$method($data);
        $this->errors = libxml_get_errors();
        libxml_clear_errors();

        return $data;
    }