Skip to content

Commit

Permalink
Added backwards compatibility with older PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
GeNyaa committed Sep 8, 2022
1 parent 9b2b531 commit e8b1f06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/Rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ class Rate extends USPSBase
/**
* Perform the API call.
*
* @param int $timeout
* Optionally override the cURL timeout.
*
* @param int $timeout Time-out in seconds.
*
* @return string
*/
public function getRate(int $timeout)
public function getRate($timeout = 60)
{
return $this->doRequest(NULL,$timeout);
}
Expand Down
6 changes: 3 additions & 3 deletions src/USPSBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ public function getResponseApiName()
* make the request.
*
* @param resource $ch Optional initialized cURL handle
* @param int $timeout
* @param int $timeout Time-out of request in seconds.
* Optional cURL timeout value.
*
*
* @return string the response text
*/
protected function doRequest($ch = null, int $timeout)
protected function doRequest($ch = null, $timeout = 60)
{
if (!$ch) {
$ch = curl_init();
Expand Down

0 comments on commit e8b1f06

Please sign in to comment.