1<?php
2
3namespace Facebook\WebDriver\Local;
4
5use Facebook\WebDriver\Exception\WebDriverException;
6use Facebook\WebDriver\Remote\DesiredCapabilities;
7use Facebook\WebDriver\Remote\RemoteWebDriver;
8
9/**
10 * @todo Break inheritance from RemoteWebDriver in next major version. (Composition over inheritance!)
11 */
12abstract class LocalWebDriver extends RemoteWebDriver
13{
14    /**
15     * @param string $selenium_server_url
16     * @param null $desired_capabilities
17     * @param null $connection_timeout_in_ms
18     * @param null $request_timeout_in_ms
19     * @param null $http_proxy
20     * @param null $http_proxy_port
21     * @param DesiredCapabilities|null $required_capabilities
22     * @throws WebDriverException
23     * @return RemoteWebDriver
24     * @todo Remove in next major version (should not be inherited)
25     */
26    public static function create(
27        $selenium_server_url = 'http://localhost:4444/wd/hub',
28        $desired_capabilities = null,
29        $connection_timeout_in_ms = null,
30        $request_timeout_in_ms = null,
31        $http_proxy = null,
32        $http_proxy_port = null,
33        DesiredCapabilities $required_capabilities = null
34    ) {
35        throw new WebDriverException('Use start() method to start local WebDriver.');
36    }
37
38    /**
39     * @param string $session_id
40     * @param string $selenium_server_url
41     * @param null $connection_timeout_in_ms
42     * @param null $request_timeout_in_ms
43     * @throws WebDriverException
44     * @return RemoteWebDriver
45     * @todo Remove in next major version (should not be inherited)
46     */
47    public static function createBySessionID(
48        $session_id,
49        $selenium_server_url = 'http://localhost:4444/wd/hub',
50        $connection_timeout_in_ms = null,
51        $request_timeout_in_ms = null
52    ) {
53        throw new WebDriverException('Use start() method to start local WebDriver.');
54    }
55}
56