Process the channel listing

@param string        $data
@param \GameQ\Result $result
179944
protected function processChannels($data, Result &$result)
    {

        // We need to split the data at the pipe
        $channels = explode('|', $data);

        // Iterate over the channels
        foreach ($channels as $channel) {
            // Offload the parsing for these values
            $properties = $this->processProperties($channel);

            // Iterate over the properties
            foreach ($properties as $key => $value) {
                $result->addTeam($key, $value);
            }
        }

        unset($data, $channel, $channels, $properties, $key, $value);
    }
363015
private static function SortByNavIndex(array &$result)
    {
        $sorted = array();
        foreach ($result as $bundle=>$modules)
        {
            ksort($modules);
            $sorted[$bundle] = $modules;
        }
        return $sorted;
    }
273532
protected function processChannel($data, $fieldCount, Result &$result)
    {

        // Split the items on the comma
        $items = explode(",", $data, $fieldCount);

        // Iterate over the items for this channel
        foreach ($items as $item) {
            // Split the key=value pair
            list($key, $value) = explode("=", $item, 2);

            $result->addTeam(strtolower($key), utf8_encode($value));
        }
    }
1027374
protected function setResult(Api\Result $result)
	{
		$this->total = $result->getTotal();
		$this->offset = 0;
		$this->max = $result->getIssuesCount();
		$this->issues = $result->getIssues();
		$this->startAt++;
	}
1363429
public function renderOnSuccess($result, SilexKernel $silexKernel)
    {
        if (!is_array($result)) {
            $result = ['result' => $result];
        }
        
        return new JsonResponse($result);
    }
724688
protected static function parsePrintableString(&$data, &$result)
    {
        // Printable string type
        $data = self::parseCommon($data, $stringData);
        $result[] = [
            'Printable String (' . self::$len . ')',
            $stringData, ];
    }
1289931
protected function sortListing(array $result)
    {
        $compare = function ($one, $two) {
            return \strnatcmp($one['path'], $two['path']);
        };

        \usort($result, $compare);

        return $result;
    }
1286635
public function processResponse()
    {

        // Grab the result from the parent
        /** @type array $result */
        $result = parent::processResponse();

        // Move some stuff around
        $this->renameResult($result, 'OwningPlayerName', 'hostname');
        $this->renameResult($result, 'p1073741825', 'mapname');
        $this->renameResult($result, 'p1073741826', 'gametype');
        $this->renameResult($result, 'p1073741827', 'servername');
        $this->renameResult($result, 'p1073741828', 'custom_mutators');
        $this->renameResult($result, 'gamemode', 'open');
        $this->renameResult($result, 's32779', 'gamemode');
        $this->renameResult($result, 's0', 'bot_skill');
        $this->renameResult($result, 's6', 'pure_server');
        $this->renameResult($result, 's7', 'password');
        $this->renameResult($result, 's8', 'vs_bots');
        $this->renameResult($result, 's10', 'force_respawn');
        $this->renameResult($result, 'p268435704', 'frag_limit');
        $this->renameResult($result, 'p268435705', 'time_limit');
        $this->renameResult($result, 'p268435703', 'numbots');
        $this->renameResult($result, 'p268435717', 'stock_mutators');

        // Put custom mutators into an array
        if (isset($result['custom_mutators'])) {
            $result['custom_mutators'] = explode("\x1c", $result['custom_mutators']);
        }

        // Delete some unknown stuff
        $this->deleteResult($result, ['s1', 's9', 's11', 's12', 's13', 's14']);

        // Return the result
        return $result;
    }
851491
function setViewResult( $result, $view = '' )
    {
        if ( $view == '' )
            $view = $this->currentView();
        $this->ViewResult[$view] = $result;
    }
738752
private function processHitResultsRecurse($results, $prefix=null) {
        if(!is_array($results)) {
            return [$prefix => $results];
        }

        $ret = [];
        foreach($results as $key=>$result) {
            // Flatten arrays.
            $sub_prefix = is_null($prefix) ? $key:"$prefix.$key";
            $ret = array_merge($ret, $this->processHitResultsRecurse($result, $sub_prefix));
        }
        return $ret;
    }
24030
protected function _sortResult(array &$result, $sort = 'asort')
    {
        // Sorting
        switch ($sort) {
            case 'asort':
                asort($result);
                break;

            case 'ksort':
                ksort($result);
                break;

            case 'natsort':
                natsort($result);
                break;

            default:
                $sort($result);
        }
    }
631964
public function complete($result)
    {
        $this->finished = true;
        $this->result = $result;

        if (!count($this->callback[self::TASK_COMPLETE])) {
            return;
        }

        foreach ($this->callback[self::TASK_COMPLETE] as $callback) {
            call_user_func($callback, $this->func, $this->handle, $result);
        }
    }
1037895
protected function prepareList($result, array $options)
    {
        $handlers = $this->getHandlers();

        if (empty($result['data'])) {
            $result['data'] = $handlers;
        } else {
            $result['data'] = array_replace_recursive($handlers, $result['data']);
        }

        foreach ($result['data'] as $handler_id => &$handler) {

            if (!empty($options['active']) && empty($handler['status'])) {
                unset($result['data'][$handler_id]);
                continue;
            }

            try {
                $handler['data'] = (array) $this->callHandler($handler_id);
            } catch (Exception $ex) {
                $handler['data'] = array();
            }
        }

        gplcart_array_sort($result['data']);
        return $result;
    }
1174500
protected function filterModelEventResults($result)
    {
        if (is_array($result)) {
            $result = array_filter($result, function ($response) {
                return ! is_null($response);
            });
        }

        return $result;
    }
147765
public function processColumnListing($results)
	{
		return array_map(function ($result) {
			return is_object($result) ? $result->column_name : $result['column_name'];
		}, $results);
	}
122357
protected function processDetails(Buffer &$buffer, Result &$result)
    {

        // We go until we hit an empty key
        while ($buffer->getLength()) {
            $key = $buffer->readString();
            if (strlen($key) == 0) {
                break;
            }
            $result->add($key, utf8_encode($buffer->readString()));
        }
    }
1317922
protected function parsePlayers(Buffer &$buffer, Result &$result)
    {
        // By default there are 0 players
        $players = 0;

        // Iterate over the players until we run out
        while (($id = $buffer->readInt8()) != 32) {
            $result->addPlayer('id', $id);
            $result->addPlayer('ping', $buffer->readInt16());
            $result->addPlayer('name', $buffer->readString());
            $result->addPlayer('clantag_pos', $buffer->readInt8());
            $result->addPlayer('clantag', $buffer->readString());
            $result->addPlayer('bot', $buffer->readInt8());
            $players++;
        }

        // Let's add in the current players as a result
        $result->add('numplayers', $players);

        // Free some memory
        unset($id);
    }