Skip to content

Commit

Permalink
phpcs clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
robocoder committed Jul 3, 2015
1 parent 0c20707 commit bb2bc96
Show file tree
Hide file tree
Showing 37 changed files with 78 additions and 41 deletions.
2 changes: 1 addition & 1 deletion lib/WebDriver/ClassLoader.php
Expand Up @@ -55,7 +55,7 @@ public static function autoload($class)
{
try {
self::loadClass($class);
} catch (Exception $e) {
} catch (\Exception $e) {
}
}
}
Expand Down
16 changes: 11 additions & 5 deletions lib/WebDriver/Container.php
Expand Up @@ -71,7 +71,7 @@ public function element($using = null, $value = null)
sprintf(
"Element not found with %s, %s\n\n%s",
$locatorJson['using'],
$locatorJson['value'],
$locatorJson['value'],
$e->getMessage()
),
$e
Expand All @@ -81,7 +81,8 @@ public function element($using = null, $value = null)
$element = $this->webDriverElement($result['value']);

if ($element === null) {
throw WebDriverException::factory(WebDriverException::NO_SUCH_ELEMENT,
throw WebDriverException::factory(
WebDriverException::NO_SUCH_ELEMENT,
sprintf(
"Element not found with %s, %s\n",
$locatorJson['using'],
Expand Down Expand Up @@ -119,9 +120,12 @@ public function elements($using = null, $value = null)
return array();
}

return array_filter(array_map(
array($this, 'webDriverElement'), $result['value']
));
return array_filter(
array_map(
array($this, 'webDriverElement'),
$result['value']
)
);
}

/**
Expand All @@ -147,12 +151,14 @@ private function parseArgs($method, $argv)

case 1:
$arg = $argv[0];

if (is_array($arg)) {
$using = $arg['using'];
$value = $arg['value'];
break;
}

// fall through
default:
throw WebDriverException::factory(
WebDriverException::JSON_PARAMETERS_EXPECTED,
Expand Down
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/CurlExec.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class CurlExec extends BaseException {
final class CurlExec extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/ElementIsNotSelectable.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class ElementIsNotSelectable extends BaseException {
final class ElementIsNotSelectable extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/ElementNotVisible.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class ElementNotVisible extends BaseException {
final class ElementNotVisible extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/IMEEngineActivationFailed.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class IMEEngineActivationFailed extends BaseException {
final class IMEEngineActivationFailed extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/IMENotAvailable.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class IMENotAvailable extends BaseException {
final class IMENotAvailable extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/InvalidCookieDomain.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class InvalidCookieDomain extends BaseException {
final class InvalidCookieDomain extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/InvalidElementCoordinates.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class InvalidElementCoordinates extends BaseException {
final class InvalidElementCoordinates extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/InvalidElementState.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class InvalidElementState extends BaseException {
final class InvalidElementState extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/InvalidRequest.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class InvalidRequest extends BaseException {
final class InvalidRequest extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/InvalidSelector.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class InvalidSelector extends BaseException {
final class InvalidSelector extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/JavaScriptError.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class JavaScriptError extends BaseException {
final class JavaScriptError extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/JsonParameterExpected.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class JsonParameterExpected extends BaseException {
final class JsonParameterExpected extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/MoveTargetOutOfBounds.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class MoveTargetOutOfBounds extends BaseException {
final class MoveTargetOutOfBounds extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoAlertOpenError.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoAlertOpenError extends BaseException {
final class NoAlertOpenError extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoParametersExpected.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoParametersExpected extends BaseException {
final class NoParametersExpected extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoSuchDriver.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoSuchDriver extends BaseException {
final class NoSuchDriver extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoSuchElement.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoSuchElement extends BaseException {
final class NoSuchElement extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoSuchFrame.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoSuchFrame extends BaseException {
final class NoSuchFrame extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/NoSuchWindow.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class NoSuchWindow extends BaseException {
final class NoSuchWindow extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/ObsoleteCommand.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class ObsoleteCommand extends BaseException {
final class ObsoleteCommand extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/ScriptTimeout.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class ScriptTimeout extends BaseException {
final class ScriptTimeout extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/SessionNotCreated.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class SessionNotCreated extends BaseException {
final class SessionNotCreated extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/StaleElementReference.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class StaleElementReference extends BaseException {
final class StaleElementReference extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/Timeout.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class Timeout extends BaseException {
final class Timeout extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnableToSetCookie.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnableToSetCookie extends BaseException {
final class UnableToSetCookie extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnexpectedAlertOpen.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnexpectedAlertOpen extends BaseException {
final class UnexpectedAlertOpen extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnexpectedParameters.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnexpectedParameters extends BaseException {
final class UnexpectedParameters extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnknownCommand.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnknownCommand extends BaseException {
final class UnknownCommand extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnknownError.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnknownError extends BaseException {
final class UnknownError extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/UnknownLocatorStrategy.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class UnknownLocatorStrategy extends BaseException {
final class UnknownLocatorStrategy extends BaseException
{
}
3 changes: 2 additions & 1 deletion lib/WebDriver/Exception/XPathLookupError.php
Expand Up @@ -29,5 +29,6 @@
*
* @package WebDriver
*/
final class XPathLookupError extends BaseException {
final class XPathLookupError extends BaseException
{
}
2 changes: 1 addition & 1 deletion lib/WebDriver/SauceLabs/SauceRest.php
Expand Up @@ -74,7 +74,7 @@ protected function execute($requestMethod, $url, $parameters = null)
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,

CURLOPT_HTTPHEADER => Array ('Expect:'),
CURLOPT_HTTPHEADER => array('Expect:'),
);

$url = 'https://saucelabs.com/rest/v1/' . $url;
Expand Down
2 changes: 1 addition & 1 deletion lib/WebDriver/ServiceFactory.php
Expand Up @@ -64,7 +64,7 @@ private function __construct()
*
* @return \WebDriver\ServiceFactory
*/
static public function getInstance()
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new self;
Expand Down
2 changes: 1 addition & 1 deletion lib/WebDriver/Session.php
Expand Up @@ -138,7 +138,7 @@ public function open($url)
*/
public function capabilities()
{
if ( ! isset($this->capabilities)) {
if (! isset($this->capabilities)) {
$result = $this->curl('GET', '');

$this->capabilities = $result['value'];
Expand Down
2 changes: 1 addition & 1 deletion lib/WebDriver/WebDriver.php
Expand Up @@ -65,7 +65,7 @@ public function session($requiredCapabilities = Browser::FIREFOX, $desiredCapabi
);

// optional
if ( ! empty($requiredCapabilities)) {
if (! empty($requiredCapabilities)) {
$parameters['requiredCapabilities'] = $requiredCapabilities;
}

Expand Down

0 comments on commit bb2bc96

Please sign in to comment.