Skip to content

Commit

Permalink
Remove unnecessary count()
Browse files Browse the repository at this point in the history
The value of the lineItems field in the downloadlineitems response will always be a string, so no need to check count(). Instead just verify whether the field exists and is non-empty.

Fixes #10
  • Loading branch information
jimper committed Jun 21, 2019
1 parent f11e57f commit 5ab7574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/examples/DownloadLineItems.php
Expand Up @@ -55,7 +55,7 @@ public function run() {
return;
}

if (!isset($result['lineItems']) || count($result['lineItems']) < 1) {
if (empty($result['lineItems'])) {
print '<p>No items found</p>';
return;
} else {
Expand Down

0 comments on commit 5ab7574

Please sign in to comment.