Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions WebDriver.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
11 changes: 6 additions & 5 deletions WebDriverBase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -39,7 +40,7 @@ protected function curl($http_method,
$params = null,
$extra_opts = array()) {
if ($params && is_array($params) && $http_method !== 'POST') {
throw(new Exception(sprintf(
throw(new \Exception(sprintf(
'The http method called for %s is %s but it has to be POST' .
' if you want to pass the JSON params %s',
$command,
Expand Down Expand Up @@ -75,7 +76,7 @@ protected function curl($http_method,

$info = curl_getinfo($curl);
if ($error = curl_error($curl)) {
throw(new Exception(sprintf(
throw(new \Exception(sprintf(
'Curl error for request %s: %s',
$url,
$error)));
Expand All @@ -92,7 +93,7 @@ protected function curl($http_method,

public function __call($name, $arguments) {
if (count($arguments) > 1) {
throw(new Exception(
throw(new \Exception(
'Commands should have at most only one parameter,' .
' which should be the JSON Parameter object'));
}
Expand All @@ -102,7 +103,7 @@ public function __call($name, $arguments) {
$webdriver_command = strtolower(substr($name, strlen($http_method)));
$default_http_method = $this->getHTTPMethod($webdriver_command);
if ($http_method === $default_http_method) {
throw(new Exception(sprintf(
throw(new \Exception(sprintf(
'%s is the default http method for %s. Please just call %s().',
$http_method,
$webdriver_command,
Expand All @@ -129,7 +130,7 @@ public function __call($name, $arguments) {

private function getHTTPMethod($webdriver_command) {
if (!array_key_exists($webdriver_command, $this->methods())) {
throw(new Exception(sprintf(
throw(new \Exception(sprintf(
'%s is not a valid webdriver command.',
$webdriver_command)));
}
Expand Down
1 change: 1 addition & 0 deletions WebDriverContainer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions WebDriverElement.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions WebDriverSession.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions WebDriverSimpleItem.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace WebDriver;
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down