Skip to content

Commit

Permalink
Only allow integer in setErrorCode and always pass integer value only
Browse files Browse the repository at this point in the history
  • Loading branch information
GeNyaa committed Apr 18, 2023
1 parent 7119efa commit df1925e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/USPSBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ protected function doRequest($ch = null, int $timeout = 60): string
$errorInfo = $this->getValueByKey($arrayResponse, 'Error');

if ($errorInfo) {
$this->setErrorCode($errorInfo['Number']);
$this->setErrorCode((int) $errorInfo['Number']);
$this->setErrorMessage($errorInfo['Description']);
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ public function getHeaders(): array
*
* @param int $code the error code number
*/
public function setErrorCode($code = 0): self
public function setErrorCode(int $code = 0): self
{
$this->errorCode = $code;

Expand Down

0 comments on commit df1925e

Please sign in to comment.