Skip to content

Commit

Permalink
Merge branch '6.x' into 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Jun 15, 2024
2 parents bb41728 + 231d547 commit 02998df
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class Options
*/
public static $arguments = [];

/**
* Apply `ChromeOptions` configuration using a callback.
*
* @var (\Closure(\Facebook\WebDriver\Chrome\ChromeOptions):(void)):null
*/
public static $chromeOptionsCallback = null;

/**
* Reset arguments.
*
Expand All @@ -54,6 +61,19 @@ public static function resetArguments(): void
static::$arguments = [];
}

/**
* Set `ChromeOptions` callback.
*
* @param (\Closure(\Facebook\WebDriver\Chrome\ChromeOptions):(void)):null $callback
* @return static
*/
public static function using($callback)

Check failure on line 70 in src/Options.php

View workflow job for this annotation

GitHub Actions / PHP:8.1 on ubuntu-latest

Method Orchestra\Testbench\Dusk\Options::using() has parameter $callback with no type specified.

Check failure on line 70 in src/Options.php

View workflow job for this annotation

GitHub Actions / PHP:8.1 on ubuntu-latest

PHPDoc tag @param has invalid value ((\Closure(\Facebook\WebDriver\Chrome\ChromeOptions):(void)):null $callback): Unexpected token ":", expected variable at offset 122
{
static::$chromeOptionsCallback = $callback;

return new static();
}

/**
* Add a browser option.
*
Expand Down Expand Up @@ -231,6 +251,8 @@ public static function getChromeOptions()
if (static::$w3cCompliant === false) {
$option->setExperimentalOption('w3c', static::$w3cCompliant);
}

value(static::$chromeOptionsCallback);
})->addArguments(static::$arguments);
}
}

0 comments on commit 02998df

Please sign in to comment.