src/Guesser/TypeGuesserChain.php
private function guess(\Closure $closure): Guess
    {
        $guesses = [];

        foreach ($this->guessers as $guesser) {
            if ($guess = $closure($guesser)) {
                $guesses[] = $guess;
            }
        }

        return Guess::getBestGuess($guesses);
    }
private function guess(\Closure $closure): Guess
    {
        $guesses = [];

        foreach ($this->guessers as $guesser) {
            if ($guess = $closure($guesser)) {
                $guesses[] = $guess;
            }
        }

        return Guess::getBestGuess($guesses);
    }
private function guess ( \ Closure $ closure ) : Guess { $ guesses = [ ] ; foreach ( $ this -> guessers as $ guesser ) { if ( $ guess = $ closure ( $ guesser ) ) { $ guesses [ ] = $ guess ; } } return Guess :: getBestGuess ( $ guesses ) ; }
Executes a closure for each guesser and returns the best guess from the
return values.

@param \Closure $closure The closure to execute. Accepts a guesser
as argument and should return a Guess instance

@return Guess The guess with the highest confidence
Executes a closure for each guesser and returns the best guess from the return values .