Skip to content

Commit df1925e

Browse files
committed
Only allow integer in setErrorCode and always pass integer value only
1 parent 7119efa commit df1925e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/USPSBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ protected function doRequest($ch = null, int $timeout = 60): string
216216
$errorInfo = $this->getValueByKey($arrayResponse, 'Error');
217217

218218
if ($errorInfo) {
219-
$this->setErrorCode($errorInfo['Number']);
219+
$this->setErrorCode((int) $errorInfo['Number']);
220220
$this->setErrorMessage($errorInfo['Description']);
221221
}
222222
}
@@ -363,7 +363,7 @@ public function getHeaders(): array
363363
*
364364
* @param int $code the error code number
365365
*/
366-
public function setErrorCode($code = 0): self
366+
public function setErrorCode(int $code = 0): self
367367
{
368368
$this->errorCode = $code;
369369

0 commit comments

Comments
 (0)