src/collections/Collection.php
public function findValue(callable $predicate, bool $findFirst = true): Option
	{
		$data = $this->find($predicate, false, $findFirst ? 1 : -1);
		
		return new Option($data[0] ?? null, isset($data[0]));
	}
public function findValue(callable $predicate, bool $findFirst = true): Option
	{
		$data = $this->find($predicate, false, $findFirst ? 1 : -1);
		
		return new Option($data[0] ?? null, isset($data[0]));
	}
public function findValue ( callable $ predicate , bool $ findFirst = true ) : Option { $ data = $ this -> find ( $ predicate , false , $ findFirst ? 1 : - 1 ) ; return new Option ( $ data [ 0 ] ?? null , isset ( $ data [ 0 ] ) ) ; }
Find a value that matches the given criteria.

@param callable $predicate : the callback function to use to find the value.
Callback signature - ($value, $key) => bool
@param bool $findFirst : if true, find the first value, otherwise find the last value
@return Option an Option possibly containing the found value
Find a value that matches the given criteria .