Skip to content

Commit

Permalink
Add support for PHP 7
Browse files Browse the repository at this point in the history
- use empty() instead of isset() to see if array is empty
  • Loading branch information
mehrancodes committed Oct 13, 2017
1 parent 81e2696 commit b474fa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
}
],
"require": {
"php" : ">=7.0",
"wmateam/curling": "^0.7.5"
},
"require-dev": {
Expand Down
7 changes: 4 additions & 3 deletions src/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Payment
* @param string $description
* @return Collection
*/
public function request(int $amount, array $params = [], string $callbackUrl = '', string $description = '')
public function request($amount, array $params = [], $callbackUrl = '', $description = '')
{
// validate the arguments before creating any request to Zarin Pal.
$this->validateArguments($callbackUrl, $description, '', true);
Expand Down Expand Up @@ -66,7 +66,7 @@ public function request(int $amount, array $params = [], string $callbackUrl = '
*
* @return Collection
*/
public function verify(int $amount, string $authority = '')
public function verify($amount, $authority = '')
{
// validate the arguments before creating any request to Zarin Pal.
$this->validateArguments(null, null, $authority);
Expand Down Expand Up @@ -202,7 +202,8 @@ private function validateArguments($callbackUrl = '', $description = '', $author
if ( !$isPaymantable && empty($authority) )
array_push($errors,'The authority field is required.');

if (isset($errors))

if (!empty($errors))
throw new HttpResponseException(response($errors));
}
}

0 comments on commit b474fa3

Please sign in to comment.