Get all nodes we are interested in pushing.

@param string $output

@return Collection
548834
protected function fetchLinkableNodes ($output, $includeImages = false)
    {
        $crawler = $this->getCrawler($output);
        $filter  = 'link, script[src]';

        if ( $includeImages ) {
            $filter .= ', img[src]';
        }

        return new Collection($crawler->filter($filter)->extract([ 'src', 'href' ]));
    }
673309
protected function getTable(OutputInterface $output)
    {
        if (!\class_exists('Symfony\Component\Console\Helper\Table')) {
            return $this->getTableHelper();
        }

        $style = new TableStyle();
        $style
            ->setVerticalBorderChar(' ')
            ->setHorizontalBorderChar('')
            ->setCrossingChar('');

        $table = new Table($output);

        return $table
            ->setRows([])
            ->setStyle($style);
    }
513419
protected function getTableMigrationDropTables(array $output, array $new, array $old): array
    {
        if (empty($old['tables'])) {
            return $output;
        }

        foreach ($old['tables'] as $tableName => $table) {
            if ($tableName === $this->options['default_migration_table']) {
                continue;
            }

            if (!isset($new['tables'][$tableName])) {
                $output[] = $this->getDropTable($tableName);
                continue;
            }
        }

        return $output;
    }
765723
public function getLocation($output = '')
    {
        $attachments = $this->getAttachments();

        $location = new \stdClass();

        if (!empty($attachments) && isset($attachments[0]['type']) && $attachments[0]['type'] === 'location') {
            $location = $attachments[0]['payload']->coordinates;
        }

        if (!empty($output)) {
            return $location->$output;
        }

        return $location;
    }
804243
public function result_collections($result)
    {
        // Combine $collection and $expanded headers
        $collections = isset($result['$collection'])
            ? array($result['$collection'])
            : array();

        if (isset($result['$expanded'])) {
            foreach ($result['$expanded'] as $expanded_collection) {
                $collections[] = $expanded_collection;
            }
        }

        return $collections;
    }
1005726
private static function populateObject($output, $source) {
        $source = json_decode(json_encode($source), true);

        foreach($source as $key => $value) {
            $method = self::createMethodNames($key);

            // Changed method_exists() to is_callable() because of the magic functions
            // @source: http://php.net/manual/en/function.method-exists.php
            if(is_callable([$output, $method])) {
                call_user_func([$output, $method], $value);
            }
        }

        return $output;
    }
91212
protected function get_other_values(renderer_base $output) {
        $values = parent::get_other_values($output);
        $values['courseid'] = $this->courseid;
        return $values;
    }
439341
protected function get_weeks(renderer_base $output) {
        $weeks = [];
        $alldays = $this->get_days();

        $daysinweek = count($this->related['type']->get_weekdays());

        // Calculate which day number is the first, and last day of the week.
        $firstdayofweek = $this->firstdayofweek;

        // The first week is special as it may have padding at the beginning.
        $day = reset($alldays);
        $firstdayno = $day['wday'];

        $prepadding = ($firstdayno + $daysinweek - $firstdayofweek) % $daysinweek;
        $daysinfirstweek = $daysinweek - $prepadding;
        $days = array_slice($alldays, 0, $daysinfirstweek);
        $week = new week_exporter($this->calendar, $days, $prepadding, ($daysinweek - count($days) - $prepadding), $this->related);
        $weeks[] = $week->export($output);

        // Now chunk up the remaining day. and turn them into weeks.
        $daychunks = array_chunk(array_slice($alldays, $daysinfirstweek), $daysinweek);
        foreach ($daychunks as $days) {
            $week = new week_exporter($this->calendar, $days, 0, ($daysinweek - count($days)), $this->related);
            $weeks[] = $week->export($output);
        }

        return $weeks;
    }
608106
public function push($result, $field = null)
    {
        $field = $this->prepareField($field ?: $result);

        $this->fields[$result] = ['$push' => $field];

        return $this;
    }
516416
function appendOutput($output) {
		if ($this->finalOutput == '') {
			$this->finalOutput = $output;
		} else {
			$this->finalOutput .= $output;
		}
		
		return $this;
	}
433630
protected function getAll($result = [])
    {

        if (array_key_exists("hits", $result)) {

            $new = [];

            foreach ($result["hits"]["hits"] as $row) {

                $model = $this->model ? new $this->model($row["_source"], true) : new Model($row["_source"], true);

                $model->setConnection($model->getConnection());
                $model->setIndex($row["_index"]);
                $model->setType($row["_type"]);

                // match earlier version

                $model->_index = $row["_index"];
                $model->_type = $row["_type"];
                $model->_id = $row["_id"];
                $model->_score = $row["_score"];

                $new[] = $model;
            }

            $new = new Collection($new);

            $new->total = $result["hits"]["total"];
            $new->max_score = $result["hits"]["max_score"];
            $new->took = $result["took"];
            $new->timed_out = $result["timed_out"];
            $new->scroll_id = isset($result["_scroll_id"]) ? $result["_scroll_id"] : NULL;
            $new->shards = (object)$result["_shards"];

            return $new;

        } else {

            return new Collection([]);

        }
    }
603431
public function collect($result = null)
    {
        $result = $result ? $result : $this->getResult();

        if ($result->rowCount() > 0) {
            $collection = new Collection();
            foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) {
                $collection->add($row);
            }

            return $collection;
        }

        return null;
    }
150291
protected function getWebPath($output)
    {
        $path = trim(dirname($output), '/');
        $count = count(explode('/', $path));

        $path = '';

        for ($i = 0; $i < $count-1; $i++) {
            $path.= '/..';
        }

        return $path;
    }
87164
private function writeToOutputNow($output)
    {
        if ($this->sendHttpCode() && \Whoops\Util\Misc::canSendHeaders()) {
            $this->system->setHttpResponseCode(
                $this->sendHttpCode()
            );
        }

        echo $output;

        return $this;
    }
653769
public function format(array $output): iterable
    {
        $previousLineType = self::LINE_TYPE_START;
        // for each line of the output
        for ($i = 0, $length = count($output); $i < $length; $i++) {
            $line = $output[$i];
            // depending on the previous line type
            // check for all possible following line types and handle it
            foreach (self::$lineTypesToCheck[$previousLineType] as $typeToCheck) {
                $call = 'is' . $typeToCheck . 'Line';
                // if the line type could be matched
                if ($this->$call($line)) {
                    // remember the line type
                    $previousLineType = $typeToCheck;
                    break;
                }
            }
        }
        $this->appendCollectedFileAndChanges();

        return $this->files;
    }
339108
protected function getColumnRemove(array $output, string $columnName): array
    {
        $output[] = sprintf("%s->removeColumn('%s')", $this->ind3, $columnName);

        return $output;
    }
845517
protected function get_other_values(renderer_base $output) {
        $return = [];
        $cache = $this->related['cache'];

        $return['events'] = array_map(function($event) use ($cache, $output) {
            $context = $cache->get_context($event);
            $course = $cache->get_course($event);
            $exporter = new event_exporter($event, ['context' => $context, 'course' => $course]);

            return $exporter->export($output);
        }, $this->events);

        if ($count = count($return['events'])) {
            $return['firstid'] = $return['events'][0]->id;
            $return['lastid'] = $return['events'][$count - 1]->id;
        }

        return $return;
    }