diff --git a/src/Api/Webpage.php b/src/Api/Webpage.php index d42876a7..6877e16e 100644 --- a/src/Api/Webpage.php +++ b/src/Api/Webpage.php @@ -95,6 +95,16 @@ public function value(string $selector): string return $this->guessLocator($selector)->inputValue(); } + /** + * Call the given Closure with this instance then return the instance. + **/ + public function tap(callable $callback): self + { + $callback($this); + + return $this; + } + /** * Gets the locator for the given selector. */