adobe / stock-api-libphp

PHP implementation of the Stock APIs
Apache License 2.0
18 stars 20 forks source link

Can't get categories of top level (parentId === 0) #15

Open filipchuk opened 4 years ago

filipchuk commented 4 years ago

Issue report

To get tree (child categories) need to use method \AdobeStock\Api\Client\SearchCategory::getCategoryTree This method has next lines: if ($request->getCategoryId() == null) { throw StockApiException::withMessage('Category Id cannot be null'); }

But categories of top level have parentId == 0. And exception thrown in this case

It could be fixed if use strict compare with null if ($request->getCategoryId() === null) { throw StockApiException::withMessage('Category Id cannot be null'); }