Iterates over registered extractors and return the first value found.

@return mixed
490567
private function extract(iterable $extractors, string $method, array $arguments)
    {
        foreach ($extractors as $extractor) {
            if (null !== $value = $extractor->{$method}(...$arguments)) {
                return $value;
            }
        }
    }
380969
public function first()
    {
        $results = $this->get();

        if (is_array($results) && array_key_exists(0, $results)) {
            return $results[0];
        }

        // No entries were returned, return false
        return false;
    }
368967
public function first()
    {
        $arr = $this->val();
        $first = reset($arr);

        return StdObjectWrapper::returnStdObject($first);
    }
984401
public function get_one()
	{
		// save the current limits
		$limit = $this->limit;
		$rows_limit = $this->rows_limit;

		if ($this->rows_limit !== null)
		{
			$this->limit = null;
			$this->rows_limit = 1;
		}
		else
		{
			$this->limit = 1;
			$this->rows_limit = null;
		}

		// get the result using normal find
		$result = $this->get();

		// put back the old limits
		$this->limit = $limit;
		$this->rows_limit = $rows_limit;

		return $result ? reset($result) : null;
	}
471460
public function first()
    {
        try {
            $query = (clone $this)->limit(1)->apply($this->database->getTablePrefixer());
            $compiled = $this->database->getGrammar()->compileSelect($query);
            return $this->database->selectFirst($compiled->getSQL(), $compiled->getBindings());
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
1272705
public function extract()
    {
        switch ($this->type) {
            case self::TYPE_KEYWORD:
                $this->keyword = strtoupper($this->token);
                if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) {
                    // Unreserved keywords should stay the way they are because they
                    // might represent field names.
                    return $this->token;
                }

                return $this->keyword;
            case self::TYPE_WHITESPACE:
                return ' ';
            case self::TYPE_BOOL:
                return strtoupper($this->token) === 'TRUE';
            case self::TYPE_NUMBER:
                $ret = str_replace('--', '', $this->token); // e.g. ---42 === -42
                if ($this->flags & self::FLAG_NUMBER_HEX) {
                    if ($this->flags & self::FLAG_NUMBER_NEGATIVE) {
                        $ret = str_replace('-', '', $this->token);
                        sscanf($ret, '%x', $ret);
                        $ret = -$ret;
                    } else {
                        sscanf($ret, '%x', $ret);
                    }
                } elseif (($this->flags & self::FLAG_NUMBER_APPROXIMATE)
                || ($this->flags & self::FLAG_NUMBER_FLOAT)
                ) {
                    sscanf($ret, '%f', $ret);
                } else {
                    sscanf($ret, '%d', $ret);
                }

                return $ret;
            case self::TYPE_STRING:
                // Trims quotes.
                $str = $this->token;
                $str = mb_substr($str, 1, -1, 'UTF-8');

                // Removes surrounding quotes.
                $quote = $this->token[0];
                $str = str_replace($quote . $quote, $quote, $str);

                // Finally unescapes the string.
                //
                // `stripcslashes` replaces escape sequences with their
                // representation.
                //
                // NOTE: In MySQL, `\f` and `\v` have no representation,
                // even they usually represent: form-feed and vertical tab.
                $str = str_replace('\f', 'f', $str);
                $str = str_replace('\v', 'v', $str);
                $str = stripcslashes($str);

                return $str;
            case self::TYPE_SYMBOL:
                $str = $this->token;
                if (isset($str[0]) && ($str[0] === '@')) {
                    // `mb_strlen($str)` must be used instead of `null` because
                    // in PHP 5.3- the `null` parameter isn't handled correctly.
                    $str = mb_substr(
                        $str,
                        (! empty($str[1]) && ($str[1] === '@')) ? 2 : 1,
                        mb_strlen($str),
                        'UTF-8'
                    );
                }
                if (isset($str[0]) && ($str[0] === ':')) {
                    $str = mb_substr($str, 1, mb_strlen($str), 'UTF-8');
                }
                if (isset($str[0]) && (($str[0] === '`')
                || ($str[0] === '"') || ($str[0] === '\''))
                ) {
                    $quote = $str[0];
                    $str = str_replace($quote . $quote, $quote, $str);
                    $str = mb_substr($str, 1, -1, 'UTF-8');
                }

                return $str;
        }

        return $this->token;
    }
816111
public function getFirst()
    {
        if (0 === count($this->data)) {
            return null;
        }
        reset($this->data);

        return current($this->data);
    }
1182691
public function takeFirst()
    {
        if (count($this->list) <= 0) {
            return null;
        }

        $value = $this->list[0];

        unset($this->list[0]);

        return $value;
    }
1264499
public function extract() {
        $pkValues = array();
        // Lose the parentheses, they mean nothing to us (more importantly, "((key = value))" fails)
        // @fixme A string primary key containing a "(" will not be returned.
        $where = str_replace(array('(', ')'), '', $this->_where);
        foreach ($this->_pkColumns as $pk) {
            $regexp = '/(?:`?' . preg_quote($this->_tableName) . '`?\.|\s|^){1}`?(?:' .
                preg_quote($pk) .
                ')`?\s?=\s?(?:(?P<q>[\'"])(?P<value>(?:(?!\k<q>).)*)\k<q>|(?P<rest>\w*))/';
            if (!preg_match($regexp, $where, $matches)) {
                continue;
            }
            // Note: backreference "rest" is there to catch unquoted
            // values. (id = 100 instead of id = "100")
            $value = $matches['value'];
            if (!empty($matches['rest'])) {
                $value = $matches['rest'];
            }
            $pkValues[$pk] = $value;
        }
        return $pkValues;
    }
593920
public function first()
    {
        try {
            $row = $this->baseQuery->first();

            if ($row === null) {
                return $row;
            } else {
                return $this->processFetchedRow($row);
            }
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
974691
public function first()
    {
        $result = $this->limit(1)->get();

        return ($result !== null && \count($result) !== 0) ? $result[0] : null;
    }
772054
public function getFirst()
    {
        $first = null;

        if (count($this->renderers) > 0) {
            $first = reset($this->renderers);
        }

        return $first;
    }
287709
public function getFirstCostValueTitleAttribute()
    {
        if ($costValues = $this->getCostValuesAttribute()) {
            if ($costValues->count() > 0) {
                return $costValues->first()->title;
            }
        }

        return null;
    }
844171
protected function _extract() {
		$message = [];

		$message[] = 'A `Catalog` class configuration with an adapter that is capable of';
		$message[] = 'handling read requests for the `messageTemplate` category is needed';
		$message[] = 'in order to proceed. This may also be referred to as `extractor`.';
		$this->out($message);
		$this->out();

		$name = $this->_configuration([
			'adapter' => 'Code',
			'path' => $this->source,
			'scope' => $this->scope
		]);
		$configs = Catalog::config();

		try {
			return Catalog::read($name, 'messageTemplate', 'root', [
				'scope' => $configs[$name]['scope'],
				'lossy' => false
			]);
		} catch (Exception $e) {
			return false;
		}
	}
381075
public function getFilteredValue()
    {
        if ($this->hasFilterer()) {
            $value = $this->getFilterer()->filter($this->getValue());
        } else {
            $value = $this->getValue();
        }

        return $value;
    }
1174721
public function firstKey()
    {
        $keys = AccessHelper::collectionKeys($this->data);

        if (empty($keys)) {
            return null;
        }

        return $keys[0];
    }
942795
public function first()
	{
		$result = $this->fetchFirst(PDO::FETCH_ASSOC);

		if($result !== false)
		{
			return $this->hydrateModelsAndLoadIncludes([$result])[0];
		}

		return false;
	}