1 | <?php |
||
12 | class BrowserFactory |
||
13 | { |
||
14 | use CommandFactoryTrait; |
||
15 | |||
16 | /** @type \Nubs\Sensible\Strategy\BrowserStrategy The browser strategy. */ |
||
17 | private $_strategy; |
||
18 | |||
19 | /** |
||
20 | * Create the browser. |
||
21 | * |
||
22 | * @api |
||
23 | * @param \Nubs\Which\Locator $commandLocator The command locator. This |
||
24 | * helps locate commands using PATH. |
||
25 | * @param string[] $browsers The names to the potential browsers. The first |
||
26 | * command in the list that can be located will be used. |
||
27 | */ |
||
28 | public function __construct(CommandLocator $commandLocator, array $browsers = ['sensible-browser', 'firefox', 'chromium-browser', 'chrome', 'elinks']) |
||
32 | |||
33 | /** |
||
34 | * Create the browser object using the strategy. |
||
35 | * |
||
36 | * @api |
||
37 | * @return \Nubs\Sensible\Browser The created browser object. |
||
38 | * @throws \Exception if no browser can be found. |
||
39 | */ |
||
40 | public function create() |
||
44 | } |
||
45 |