Turns a collection of completed processes into a
collection of parsed result objects.
@param Collection $completedProcesses Collection of completed processes.
@return ResultCollection
170155
public function parse(Collection $completedProcesses): ResultCollection
    {
        $this->resultsCollection = new ResultCollection;

        foreach ($completedProcesses as $file => $processes) {
            $this->parseCompletedProcessesForFile($file, $processes);
        }

        return $this->resultsCollection;
    }
1157110
private function processes()
    {
        return collect($this->supervisors->all())->pluck('processes')->reduce(function ($final, $queues) {
            foreach ($queues as $queue => $processes) {
                $final[$queue] = isset($final[$queue]) ? $final[$queue] + $processes : $processes;
            }

            return $final;
        }, []);
    }
1367754
public function hydrateCollection(array $classes, Traversable $resultSet)
    {
        $collection = new ArrayCollection();
        foreach ($resultSet as $document) {
            foreach ($classes as $class) {
                if ($document->getIndex() == $class->index && $document->getType() == $class->type) {
                    break;
                }
            }
            $collection[] = $this->hydrateEntity($class, $document);
        }

        return $collection;
    }
147765
public function processColumnListing($results)
	{
		return array_map(function ($result) {
			return is_object($result) ? $result->column_name : $result['column_name'];
		}, $results);
	}
97462
public function startAllProcesses($wait = true)
    {
        if (empty($this->groups)) {
            return parent::startAllProcesses($wait);
        }

        $results = [];

        foreach ($this->groups as $group) {
            $results = array_merge($results, parent::startProcessGroup($group, $wait));
        }

        return $results;
    }
1245887
public function getResult()
    {
        $result = $this->execute();
        $list = new ArrayCollection;

        //Loop through results
        foreach ($result as $row)
        {
            $entry = array();

            //Loop through entities attributes (or relations)
            foreach ($row as $key => $value)
            {
                $entry[$key] = $this->convertValue($value);
            }

            //Add to list
            $list->add($entry);
        }

        return $list;
    }
769212
public function processAssertions(ArrayCollection $assertions) : ArrayCollection
    {
        $processed = new ArrayCollection();
        foreach ($assertions->getIterator() as $assertion) {
            $processed->add($this->process($assertion));
        }

        return $processed;
    }
782128
public function getAll($params = [])
    {
        $result = $this->connection()->get($this->getEndpoint(), $params, true);

        return $this->collectionFromResult($result);
    }
1024880
private function batchesFinished($batchesResult)
    {
        $allfinished = true;
        foreach ($batchesResult as $key => $batch) {
            if ($batch['Status'] != 'Completed') {
                $allfinished = false;
            }
        }
        return $allfinished;
    }
559634
public function all()
    {
        $result = [];
        foreach ($this->collection->find() as $document) {
            $result[] = [
                'program' => $document['program'],
                'process' => $document['process'],
            ];
        }
        return $result;
    }
1194021
public function parserResult($result)
    {
        if ($this->presenter instanceof PresenterInterface) {
            if ($result instanceof Collection || $result instanceof LengthAwarePaginator) {
                $result->each(function ($model) {
                    if ($model instanceof Presentable) {
                        $model->setPresenter($this->presenter);
                    }

                    return $model;
                });
            } elseif ($result instanceof Presentable) {
                $result = $result->setPresenter($this->presenter);
            }

            if (!$this->skipPresenter) {
                return $this->presenter->present($result);
            }
        }

        return $result;
    }
660088
protected function aggregateMemory($processes)
    {
        $memory = array();

        foreach ($processes as $process) {
            if (isset($memory[$process->getName()])) {
                $memory[$process->getName()] += $process->getMemory();
            }
            else {
                $memory[$process->getName()] = $process->getMemory();
            }
        }

        return $memory;
    }
821504
private function prepareProductCollection(ProductCollection $collection)
    {
        foreach ($this->collectionProcessors as $processor) {
            $collection = $processor->prepareCollection($collection);
        }

        return $collection;
    }
368064
protected function processResult(array $results)
    {
        foreach ($results as $key => $entity) {

            if (!empty($entity['data'])) {

                $entity['data'] = $this->decorator->denormalizeValue($entity['data']);
                $results[$key] = $entity;
            }
        }

        return $results;
    }
104552
private function getTranslationsData($processCore, array $packagesToProcess)
    {
        if ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
            $this->output->write('# Fetching list of translations... ');
        }
        $result = [];
        if ($processCore) {
            $result[] = $this->translationsChecker->getCoreTranslations();
        }
        foreach ($packagesToProcess as $package) {
            $result[] = $this->translationsChecker->getPackageTranslations($package);
        }
        if ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
            $this->output->writeln('done.');
        }

        return $result;
    }
717414
private function processResults($results)
    {
        $entries = $this->connection->getEntries($results);

        $objects = [];

        if (array_key_exists('count', $entries)) {
            for ($i = 0; $i < $entries['count']; $i++) {
                $entry = $this->newLdapEntry($entries[$i], $this->connection);

                $objects[] = $entry->getAttributes();
            }

            if (!empty($this->sortByField)) {
                return $this->processSortBy($objects);
            }
        }

        return $objects;
    }
290826
public function check(Subject $subject): ResultCollection
    {
        $resultCollection = new ResultCollection();

        foreach ($this->collection as $rule) {
            $resultCollection->merge($rule->check($subject));
        }

        return $resultCollection;
    }