Returns the highest value from the collection of values

Key can be a string key or callable. Based on Laravel: Illuminate\Support\Collection.max

@param null|string $key

@return mixed
556025
public function max($key = null)
    {
        $callback = $this->valueAccessor($key);

        return $this->filter(function ($value) {
            return !is_null($value);
        })->reduce(function ($result, $item) use ($callback) {
            $value = $callback($item);

            return is_null($result) || $value > $result ? $value : $result;
        });
    }
1244620
public function get($key) {
        if ($this->hashMap->containsKey($key)) {
            $node = $this->getNodeFromHead($key);
            $this->unset($node);
            $this->updateHead($node);
            return $this->head->getValue();
        }
        return null;
    }
1010123
protected function _get_array_value( $key ) {
		if ( ! isset( $this->types[ $key ] ) || 'array' !== $this->types[ $key ] ) {
			return null;
		}

		$default = array_key_exists( $key, $this->defaults ) ? $this->defaults[ $key ] : [];

		// @todo Could be taken a step further to array map strval?
		return (array) $this->store->get( $key, $default );
	}
1157099
public function pluck(string $key): ArrayCollection
    {
        return $this->map(function ($value) use ($key) {
            return $value[$key] ?? null;
        });
    }
124966
public function rateLimit($key = null) {
		return $key ? (isset($this->rate_limit[$key]) ? $this->rate_limit[$key] : null) : $this->rate_limit;
	}
692182
public function getArray($key = null) {
        if (!is_null($key)) {
            return $this->getDeepValue($key);
        } else {
            return $this->_data;
        }
    }
149279
public function getParamValue($key)
    {
        $value = null;
        if (is_array($param = $this->getParam($key))) {
            $value = $param['value'];
        }

        return $value;
    }
582042
public function getRaw($key = null){
        if(null === $key){
            return $this->_data;
        }
        else{
            return isset($this->_data[$key])?$this->_data[$key]:null;
        }
    }
978016
public function GetValueCache($key)
	{
		// save the trouble of retrieving the cache if it is not enabled
		if ($this->ValueCacheTimeout <= 0) return null;

		if (strlen($key) > 250) $key = substr($key,0,150) . md5($key);
		$obj = $this->_level1Cache->Get(md5($key));
		return $obj ? $obj : $this->_level2Cache->Get($key);
	}
246641
public function get($key)
    {
        $key       = (string)$key;
        $value     = null;
        $this->hit = false;

        if (\array_key_exists($key, self::$registry)) {
            if (self::$registry[$key]['expires'] >= (new DateTime())) {
                $this->hit = true;
                return $this->restoreDataStructure($key);
            }
            unset(self::$registry[$key]);
        }

        return $value;
    }
948351
public function get($key)
    {
        $value = $this->connection()->get($this->prefix.$key);

        return ! is_null($value) ? $this->unserialize($value) : null;
    }
1194862
public function get($key)
    {
        if( isset($this->values[$key]) ) {
            return $this->values[$key];
        } else {
            return null;
        }
    }
1324419
public function key(string $key = null)
    {
        if ($key) {
            $this->field['key'] = $key;

            return $this;
        }

        return $this->field['key'];
    }
312209
public static function getRangeMap($key=NULL)
    {
        if ($key) {
            return isset(self::$_keyRangeMap[$key]) ? self::$_keyRangeMap[$key] : NULL;
        } else {
            return self::$_keyRangeMap;
        }
    }
357501
private function getNestedValueByKey($key)
    {
        if (isset($this->nestedKeyCache[$key])) {
            return $this->nestedKeyCache[$key];
        }

        // Check to see if this is targeting an instance of ArrayContainer and grab it from the nested container
        $keyParts = explode('.', $key);
        if ($this->get($keyParts[0]) instanceof self && $arrayContainer = $this->get($keyParts[0])) {
            array_shift($keyParts);
            /* @var ArrayContainer $arrayContainer */
            $value = $arrayContainer->get(implode('.', $keyParts));
        } else {
            $value = $this->items;
            foreach (explode('.', $key) as $keyPart) {
                if ((! is_array($value) || ! $value instanceof self)) {
                    if (is_object($value) && method_exists($value, 'arrayAccessByKey')) {
                        if ($value = $value->arrayAccessByKey($keyPart)) {
                            break;
                        } else {
                            return null;
                        }
                    }
                }

                if (! isset($value[$keyPart])) {
                    return null;
                }

                if (is_array($value[$keyPart]) && ! array_key_exists($keyPart, $value)) {
                    return null;
                }
                $value = $value[$keyPart];
            }
        }

        $this->nestedKeyCache[$key] = $value;

        return $value;
    }
1006092
public function getServerValue($key)
    {
        $key    = strtolower($key);
        $server = $this->getServer();
        $return = null;
        if (isset($server[$key])) {
            $return = $server[$key];
        }
        unset($server);
        return $return;
    }
1191706
public function getString($key)
    {
        try {
            $result = $this->get(self::STRING, $key);
            if (!settype($result, 'string')) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }