Skip to content

Commit 703f900

Browse files
committed
phpstan config (up to level 4) + cleanup
1 parent c632618 commit 703f900

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

lib/WebDriver/AbstractWebDriver.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public function getURL()
9090
/**
9191
* Curl request to webdriver server.
9292
*
93-
* @param string $requestMethod HTTP request method, e.g., 'GET', 'POST', or 'DELETE'
94-
* @param string $command If not defined in methods() this function will throw.
95-
* @param array $parameters If an array(), they will be posted as JSON parameters
96-
* If a number or string, "/$params" is appended to url
97-
* @param array $extraOptions key=>value pairs of curl options to pass to curl_setopt()
93+
* @param string $requestMethod HTTP request method, e.g., 'GET', 'POST', or 'DELETE'
94+
* @param string $command If not defined in methods() this function will throw.
95+
* @param array|integer|string $parameters If an array(), they will be posted as JSON parameters
96+
* If a number or string, "/$params" is appended to url
97+
* @param array $extraOptions key=>value pairs of curl options to pass to curl_setopt()
9898
*
9999
* @return array array('value' => ..., 'info' => ...)
100100
*

lib/WebDriver/Container.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ protected function webDriverElement($value)
224224
$value[self::WEBDRIVER_ELEMENT_ID] // id
225225
);
226226
}
227+
228+
return null;
227229
}
228230

229231
/**

lib/WebDriver/Exception/CurlExec.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ final class CurlExec extends BaseException
3838
private $curlInfo = array();
3939

4040
/**
41-
* {@inheritdoc}
41+
* Get curl info
42+
*
43+
* @return array
4244
*/
43-
public function __construct($message = null, $code = 0, \Exception $previous = null, $curlInfo = array())
45+
public function getCurlInfo()
4446
{
45-
parent::__construct($message, $code, $previous);
46-
47-
$this->curlInfo = $curlInfo;
47+
return $this->curlInfo;
4848
}
4949

5050
/**
51-
* Get curl info
51+
* Set curl info
5252
*
53-
* @return array
53+
* @param array $curlInfo
5454
*/
55-
public function getCurlInfo()
55+
public function setCurlInfo($curlInfo)
5656
{
57-
return $this->curlInfo;
57+
$this->curlInfo = $curlInfo;
5858
}
5959
}

lib/WebDriver/SauceLabs/SauceRest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function getStatus()
292292
*
293293
* @return array
294294
*/
295-
public function getBrowsers($termination = false)
295+
public function getBrowsers($termination = '')
296296
{
297297
if ($termination) {
298298
return $this->execute('GET', 'info/browsers/' . $termination);

lib/WebDriver/ServiceFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private function __construct()
6666
*/
6767
public static function getInstance()
6868
{
69-
if (!self::$instance) {
69+
if (self::$instance === null) {
7070
self::$instance = new self;
7171
}
7272

lib/WebDriver/Timeouts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function methods()
4747
/**
4848
* helper method to wait until user-defined condition is met
4949
*
50-
* @param function $callback callback which returns non-false result if wait condition was met
50+
* @param callable $callback callback which returns non-false result if wait condition was met
5151
* @param integer $maxIterations maximum number of iterations
5252
* @param integer $sleep sleep duration in seconds between iterations
5353
* @param array $args optional args; if the callback needs $this, then pass it here

lib/WebDriver/WebDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* @package WebDriver
2929
*
30-
* @method status
30+
* @method array status() Returns information about whether a remote end is in a state in which it can create new sessions.
3131
*/
3232
class WebDriver extends AbstractWebDriver implements WebDriverInterface
3333
{

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 4
3+
paths:
4+
- lib

0 commit comments

Comments
 (0)