lib/WebDriverExpectedCondition.php
public static function refreshed(self $condition)
    {
        return new static(
            function (WebDriver $driver) use ($condition) {
                try {
                    return call_user_func($condition->getApply(), $driver);
                } catch (StaleElementReferenceException $e) {
                    return null;
                }
            }
        );
    }
public static function refreshed(self $condition)
    {
        return new static(
            function (WebDriver $driver) use ($condition) {
                try {
                    return call_user_func($condition->getApply(), $driver);
                } catch (StaleElementReferenceException $e) {
                    return null;
                }
            }
        );
    }
public static function refreshed ( self $ condition ) { return new static ( function ( WebDriver $ driver ) use ( $ condition ) { try { return call_user_func ( $ condition -> getApply ( ) , $ driver ) ; } catch ( StaleElementReferenceException $ e ) { return null ; } } ) ; }
Wrapper for a condition, which allows for elements to update by redrawing.

This works around the problem of conditions which have two parts: find an element and then check for some
condition on it. For these conditions it is possible that an element is located and then subsequently it is
redrawn on the client. When this happens a StaleElementReferenceException is thrown when the second part of
the condition is checked.

@param WebDriverExpectedCondition $condition The condition wrapped.
@return static Condition returns the return value of the getApply() of the given condition.
Wrapper for a condition which allows for elements to update by redrawing .