annotate vendor/jcalderonzumba/gastonjs/src/Browser/BrowserNavigateTrait.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Zumba\GastonJS\Browser;
Chris@0 4
Chris@0 5 use Zumba\GastonJS\Exception\BrowserError;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Trait BrowserNavigateTrait
Chris@0 9 * @package Zumba\GastonJS\Browser
Chris@0 10 */
Chris@0 11 trait BrowserNavigateTrait {
Chris@0 12
Chris@0 13 /**
Chris@0 14 * Send a visit command to the browser
Chris@0 15 * @param $url
Chris@0 16 * @return mixed
Chris@0 17 */
Chris@0 18 public function visit($url) {
Chris@0 19 return $this->command('visit', $url);
Chris@0 20 }
Chris@0 21
Chris@0 22 /**
Chris@0 23 * Gets the current url we are in
Chris@0 24 * @return mixed
Chris@0 25 */
Chris@0 26 public function currentUrl() {
Chris@0 27 return $this->command('current_url');
Chris@0 28 }
Chris@0 29
Chris@0 30 /**
Chris@0 31 * Goes back on the browser history if possible
Chris@0 32 * @return bool
Chris@0 33 * @throws BrowserError
Chris@0 34 * @throws \Exception
Chris@0 35 */
Chris@0 36 public function goBack() {
Chris@0 37 return $this->command('go_back');
Chris@0 38 }
Chris@0 39
Chris@0 40 /**
Chris@0 41 * Goes forward on the browser history if possible
Chris@0 42 * @return mixed
Chris@0 43 * @throws BrowserError
Chris@0 44 * @throws \Exception
Chris@0 45 */
Chris@0 46 public function goForward() {
Chris@0 47 return $this->command('go_forward');
Chris@0 48 }
Chris@0 49
Chris@0 50 /**
Chris@0 51 * Reloads the current page we are in
Chris@0 52 */
Chris@0 53 public function reload() {
Chris@0 54 return $this->command('reload');
Chris@0 55 }
Chris@0 56 }