Skip to content
Open
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
5 changes: 3 additions & 2 deletions src/Eth.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ class Eth
* construct
*
* @param string|\Web3\Providers\Provider $provider
* @param int $timeout
* @return void
*/
public function __construct($provider)
public function __construct($provider, $timeout = 1)
{
if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) {
// check the uri schema
if (preg_match('/^https?:\/\//', $provider) === 1) {
$requestManager = new HttpRequestManager($provider);
$requestManager = new HttpRequestManager($provider, $timeout);

$this->provider = new HttpProvider($requestManager);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Net.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ class Net
* construct
*
* @param string|\Web3\Providers\Provider $provider
* @param int $timeout
* @return void
*/
public function __construct($provider)
public function __construct($provider, $timeout = 1)
{
if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) {
// check the uri schema
if (preg_match('/^https?:\/\//', $provider) === 1) {
$requestManager = new HttpRequestManager($provider);
$requestManager = new HttpRequestManager($provider, $timeout);

$this->provider = new HttpProvider($requestManager);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ class Personal
* construct
*
* @param string|\Web3\Providers\Provider $provider
* @param int $timeout
* @return void
*/
public function __construct($provider)
public function __construct($provider, $timeout = 1)
{
if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) {
// check the uri schema
if (preg_match('/^https?:\/\//', $provider) === 1) {
$requestManager = new HttpRequestManager($provider);
$requestManager = new HttpRequestManager($provider, $timeout);

$this->provider = new HttpProvider($requestManager);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Shh.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ class Shh
* construct
*
* @param string|\Web3\Providers\Provider $provider
* @param int $timeout
* @return void
*/
public function __construct($provider)
public function __construct($provider, $timeout = 1)
{
if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) {
// check the uri schema
if (preg_match('/^https?:\/\//', $provider) === 1) {
$requestManager = new HttpRequestManager($provider);
$requestManager = new HttpRequestManager($provider, $timeout);

$this->provider = new HttpProvider($requestManager);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Web3.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ class Web3
* construct
*
* @param string|\Web3\Providers\Provider $provider
* @param int $timeout
* @return void
*/
public function __construct($provider)
public function __construct($provider, $timeout = 1)
{
if (is_string($provider) && (filter_var($provider, FILTER_VALIDATE_URL) !== false)) {
// check the uri schema
if (preg_match('/^https?:\/\//', $provider) === 1) {
$requestManager = new HttpRequestManager($provider);
$requestManager = new HttpRequestManager($provider, $timeout);

$this->provider = new HttpProvider($requestManager);
}
Expand Down