smartystreets / smartystreets-php-sdk

The official client libraries for accessing SmartyStreets APIs from the PHP Hypertext Processor.
https://smartystreets.com/docs/sdk/php
Apache License 2.0
28 stars 15 forks source link

Improper use of count() on string #10

Closed petersontubini closed 6 years ago

petersontubini commented 6 years ago

You can't use count() on PHP strings because they don't implement Countable, you must use strlen or it'll throw an exception.

private function fieldIsMissing($field) {
    return $field == null || count($field) == 0;
}
MouaYing commented 6 years ago

@petersontubini - Thank you for bringing this to our attention. This has been fixed in commit 3a99142e5eda2a0952054ffcedfce26c3d0bf098.