public function when($result)
    {
        if (\is_callable($result)) {
            $result = $result();
        }

        if ($this->can_proceed() && $result !== true) {
            $this->shortcircuit = true;
        }

        return $this;
    }
public function when($result)
    {
        if (\is_callable($result)) {
            $result = $result();
        }

        if ($this->can_proceed() && $result !== true) {
            $this->shortcircuit = true;
        }

        return $this;
    }
public function when ( $ result ) { if ( \ is_callable ( $ result ) ) { $ result = $ result ( ) ; } if ( $ this -> can_proceed ( ) && $ result !== true ) { $ this -> shortcircuit = true ; } return $ this ; }
Check if a custom expression returns true.

@since 1.0.0

@param  bool|callable $result The result of a custom expression.
@return Router
Check if a custom expression returns true .