Skip to content

Commit 07ab9b5

Browse files
committed
Minor codestyle fixes
1 parent 4967a61 commit 07ab9b5

11 files changed

+58
-32
lines changed

lib/Chrome/ChromeOptions.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ public function addExtensions(array $paths) {
8585
}
8686

8787
/**
88-
* @param array $encoded_extensions An array of base64 encoded of the
89-
* extensions.
88+
* @param array $encoded_extensions An array of base64 encoded of the extensions.
9089
* @return ChromeOptions
9190
*/
9291
public function addEncodedExtensions(array $encoded_extensions) {
@@ -109,8 +108,7 @@ public function setExperimentalOption($name, $value) {
109108
}
110109

111110
/**
112-
* @return DesiredCapabilities The DesiredCapabilities for Chrome with this
113-
* options.
111+
* @return DesiredCapabilities The DesiredCapabilities for Chrome with this options.
114112
*/
115113
public function toCapabilities() {
116114
$capabilities = DesiredCapabilities::chrome();

lib/Firefox/FirefoxDriver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
namespace Facebook\WebDriver\Firefox;
1717

1818
class FirefoxDriver {
19-
2019
const PROFILE = 'firefox_profile';
20+
21+
private function __construct()
22+
{
23+
}
2124
}

lib/Firefox/FirefoxProfile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function addExtension($extension) {
5555
/**
5656
* @param string $extension_datas The path to the folder containing the datas to add to the extension
5757
* @return FirefoxProfile
58-
*/
58+
*/
5959
public function addExtensionDatas($extension_datas) {
6060
if (!is_dir($extension_datas)) {
6161
return;
@@ -73,7 +73,7 @@ public function setRdfFile($rdf_file) {
7373
if (!is_file($rdf_file)) {
7474
return;
7575
}
76-
76+
7777
$this->rdf_file = $rdf_file;
7878
return $this;
7979
}

lib/Remote/DriverCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* This list of command defined in the WebDriver json wire protocol.
2020
*/
2121
class DriverCommand {
22-
2322
const GET_ALL_SESSIONS = "getAllSessions";
2423
const GET_CAPABILITIES = "getCapabilities";
2524
const NEW_SESSION = "newSession";
@@ -126,16 +125,14 @@ class DriverCommand {
126125
const SET_SCREEN_ORIENTATION = "setScreenOrientation";
127126
const GET_SCREEN_ORIENTATION = "getScreenOrientation";
128127

129-
// These belong to the Advanced user interactions - an element is
130-
// optional for these commands.
128+
// These belong to the Advanced user interactions - an element is optional for these commands.
131129
const CLICK = "mouseClick";
132130
const DOUBLE_CLICK = "mouseDoubleClick";
133131
const MOUSE_DOWN = "mouseButtonDown";
134132
const MOUSE_UP = "mouseButtonUp";
135133
const MOVE_TO = "mouseMoveTo";
136134

137-
// Those allow interactions with the Input Methods installed on
138-
// the system.
135+
// Those allow interactions with the Input Methods installed on the system.
139136
const IME_GET_AVAILABLE_ENGINES = "imeGetAvailableEngines";
140137
const IME_GET_ACTIVE_ENGINE = "imeGetActiveEngine";
141138
const IME_IS_ACTIVATED = "imeIsActivated";
@@ -168,4 +165,7 @@ class DriverCommand {
168165
const GET_NETWORK_CONNECTION = "getNetworkConnection";
169166
const SET_NETWORK_CONNECTION = "setNetworkConnection";
170167

168+
private function __construct()
169+
{
170+
}
171171
}

lib/Remote/RemoteWebDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function create(
7474
) {
7575
$url = preg_replace('#/+$#', '', $url);
7676

77-
// Passing DesiredCapabilities as $desired_capabilities is encourged but
77+
// Passing DesiredCapabilities as $desired_capabilities is encouraged but
7878
// array is also accepted for legacy reason.
7979
if ($desired_capabilities instanceof DesiredCapabilities) {
8080
$desired_capabilities = $desired_capabilities->toArray();

lib/Remote/Service/DriverCommandExecutor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ public function __construct(DriverService $service) {
3838

3939
/**
4040
* @param WebDriverCommand $command
41-
* @param array $curl_opts
4241
*
4342
* @return mixed
4443
* @throws WebDriverException
4544
* @throws \Exception
4645
*/
47-
public function execute(WebDriverCommand $command, $curl_opts = array()) {
46+
public function execute(WebDriverCommand $command) {
4847
if ($command->getName() === DriverCommand::NEW_SESSION) {
4948
$this->service->start();
5049
}

lib/Remote/WebDriverBrowserType.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* All the browsers supported by selenium
2020
*/
2121
class WebDriverBrowserType {
22-
2322
const FIREFOX = "firefox";
2423
const FIREFOX_2 = "firefox2";
2524
const FIREFOX_3 = "firefox3";
@@ -42,4 +41,8 @@ class WebDriverBrowserType {
4241
const IPHONE = "iphone";
4342
const IPAD = "iPad";
4443
const PHANTOMJS = "phantomjs";
44+
45+
private function __construct()
46+
{
47+
}
4548
}

lib/Remote/WebDriverCapabilityType.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
namespace Facebook\WebDriver\Remote;
1717

1818
/**
19-
* WebDriverCapabilityType contains all constants defined in the WebDriver
20-
* Wire Protocol.
19+
* WebDriverCapabilityType contains all constants defined in the WebDriver Wire Protocol.
2120
*/
2221
class WebDriverCapabilityType {
23-
2422
const BROWSER_NAME = 'browserName';
2523
const VERSION = 'version';
2624
const PLATFORM = 'platform';
@@ -37,4 +35,8 @@ class WebDriverCapabilityType {
3735
const ACCEPT_SSL_CERTS = 'acceptSslCerts';
3836
const NATIVE_EVENTS = 'nativeEvents';
3937
const PROXY = 'proxy';
38+
39+
private function __construct()
40+
{
41+
}
4042
}

lib/Remote/WebDriverCommand.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,41 @@
1616
namespace Facebook\WebDriver\Remote;
1717

1818
class WebDriverCommand {
19-
19+
/** @var string */
2020
private $sessionID;
21+
/** @var string */
2122
private $name;
23+
/** @var array */
2224
private $parameters;
2325

26+
/**
27+
* @param string $session_id
28+
* @param string $name Constant from DriverCommand
29+
* @param array $parameters Array of
30+
*/
2431
public function __construct($session_id, $name, $parameters) {
2532
$this->sessionID = $session_id;
2633
$this->name = $name;
2734
$this->parameters = $parameters;
2835
}
2936

37+
/**
38+
* @return string
39+
*/
3040
public function getName() {
3141
return $this->name;
3242
}
3343

44+
/**
45+
* @return string
46+
*/
3447
public function getSessionID() {
3548
return $this->sessionID;
3649
}
3750

51+
/**
52+
* @return array
53+
*/
3854
public function getParameters() {
3955
return $this->parameters;
4056
}

lib/WebDriverPlatform.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* The platforms supported by WebDriver.
2020
*/
2121
class WebDriverPlatform {
22-
2322
const ANDROID = 'ANDROID';
2423
const ANY = 'ANY';
2524
const LINUX = 'LINUX';
@@ -28,4 +27,8 @@ class WebDriverPlatform {
2827
const VISTA = 'VISTA';
2928
const WINDOWS = 'WINDOWS';
3029
const XP = 'XP';
30+
31+
private function __construct()
32+
{
33+
}
3134
}

0 commit comments

Comments
 (0)