src/Viserio/Component/Routing/Route/Action.php
protected static function getFirst(array $array, callable $callback)
    {
        foreach ($array as $key => $value) {
            if ($callback($key, $value)) {
                return $value;
            }
        }

        return null;
    }
protected static function getFirst(array $array, callable $callback)
    {
        foreach ($array as $key => $value) {
            if ($callback($key, $value)) {
                return $value;
            }
        }

        return null;
    }
Return the first element in an array passing a given truth test.

@param array    $array
@param callable $callback

@return mixed