Skip to content

Commit a109df9

Browse files
committed
Rename "results" to "result" (for consistency)
1 parent fe3d58f commit a109df9

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

lib/WebDriver/AbstractWebDriver.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ protected function curl($requestMethod, $command, $parameters = null, $extraOpti
120120
$url .= '/' . $parameters;
121121
}
122122

123-
list($rawResults, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions);
123+
list($rawResult, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions);
124124

125-
$results = json_decode($rawResults, true);
125+
$result = json_decode($rawResult, true);
126126
$value = null;
127127

128-
if (is_array($results) && array_key_exists('value', $results)) {
129-
$value = $results['value'];
128+
if (is_array($result) && array_key_exists('value', $result)) {
129+
$value = $result['value'];
130130
}
131131

132132
$message = null;
@@ -136,12 +136,12 @@ protected function curl($requestMethod, $command, $parameters = null, $extraOpti
136136
}
137137

138138
// if not success, throw exception
139-
if ((int) $results['status'] !== 0) {
140-
throw WebDriverException::factory($results['status'], $message);
139+
if ((int) $result['status'] !== 0) {
140+
throw WebDriverException::factory($result['status'], $message);
141141
}
142142

143-
$sessionId = isset($results['sessionId'])
144-
? $results['sessionId']
143+
$sessionId = isset($result['sessionId'])
144+
? $result['sessionId']
145145
: (isset($value['webdriver.remote.sessionid'])
146146
? $value['webdriver.remote.sessionid']
147147
: null);
@@ -193,13 +193,13 @@ public function __call($name, $arguments)
193193
);
194194
}
195195

196-
$results = $this->curl(
196+
$result = $this->curl(
197197
$requestMethod,
198198
'/' . $webdriverCommand,
199199
array_shift($arguments)
200200
);
201201

202-
return $results['value'];
202+
return $result['value'];
203203
}
204204

205205
/**

lib/WebDriver/Container.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function element($using = null, $value = null)
6060
$locatorJson = $this->parseArgs('element', func_get_args());
6161

6262
try {
63-
$results = $this->curl(
63+
$result = $this->curl(
6464
'POST',
6565
'/element',
6666
$locatorJson
@@ -78,7 +78,7 @@ public function element($using = null, $value = null)
7878
);
7979
}
8080

81-
$element = $this->webDriverElement($results['value']);
81+
$element = $this->webDriverElement($result['value']);
8282

8383
if ($element === null) {
8484
throw WebDriverException::factory(WebDriverException::NO_SUCH_ELEMENT,
@@ -109,18 +109,18 @@ public function elements($using = null, $value = null)
109109
{
110110
$locatorJson = $this->parseArgs('elements', func_get_args());
111111

112-
$results = $this->curl(
112+
$result = $this->curl(
113113
'POST',
114114
'/elements',
115115
$locatorJson
116116
);
117117

118-
if (!is_array($results['value'])) {
118+
if (!is_array($result['value'])) {
119119
return array();
120120
}
121121

122122
return array_filter(array_map(
123-
array($this, 'webDriverElement'), $results['value']
123+
array($this, 'webDriverElement'), $result['value']
124124
));
125125
}
126126

lib/WebDriver/SauceLabs/SauceRest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ protected function execute($requestMethod, $url, $parameters = null)
7373

7474
$url = 'https://saucelabs.com/rest/v1/' . $url;
7575

76-
list($rawResults, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions);
76+
list($rawResult, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions);
7777

78-
return json_decode($rawResults, true);
78+
return json_decode($rawResult, true);
7979
}
8080

8181
/**

lib/WebDriver/Service/CurlService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
8282

8383
curl_setopt($curl, CURLOPT_HTTPHEADER, $customHeaders);
8484

85-
$rawResults = trim(curl_exec($curl));
85+
$rawResult = trim(curl_exec($curl));
8686
$info = curl_getinfo($curl);
8787

8888
if (CURLE_GOT_NOTHING !== curl_errno($curl) && $error = curl_error($curl)) {
@@ -99,6 +99,6 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
9999

100100
curl_close($curl);
101101

102-
return array($rawResults, $info);
102+
return array($rawResult, $info);
103103
}
104104
}

lib/WebDriver/Session.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ public function ime()
348348
*/
349349
public function activeElement()
350350
{
351-
$results = $this->curl('POST', '/element/active');
351+
$result = $this->curl('POST', '/element/active');
352352

353-
return $this->webDriverElement($results['value']);
353+
return $this->webDriverElement($result['value']);
354354
}
355355

356356
/**
@@ -417,9 +417,9 @@ public function log()
417417
)
418418
}
419419

420-
$this->curl('POST', '/log', $arg);
420+
$result = $this->curl('POST', '/log', $arg);
421421

422-
return $this;
422+
eeturn $result['value'];
423423
}
424424

425425
// chaining

lib/WebDriver/WebDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ public function session($requiredCapabilities = Browser::FIREFOX, $desiredCapabi
6969
$parameters['requiredCapabilities'] = $requiredCapabilities;
7070
}
7171

72-
$results = $this->curl(
72+
$result = $this->curl(
7373
'POST',
7474
'/session',
7575
$parameters,
7676
array(CURLOPT_FOLLOWLOCATION => true)
7777
);
7878

79-
return new Session($results['sessionUrl']);
79+
return new Session($result['sessionUrl']);
8080
}
8181

8282
/**

0 commit comments

Comments
 (0)