$result = $cdek->cities()->getFiltered(['country_codes' => 'RU', 'city' => 'зеленогорск']);
if ($result->isOk()) {
//Запрос успешно выполнился
$cities = $cdek->formatResponseList($result, \CdekSDK2\Dto\CityList::class);
foreach($cities->items as $city) {
$city->city;
$city->code;
$city->fias_guid;
}
}
CdekSDK2\Http\ApiResponse Object
(
[body:CdekSDK2\Http\ApiResponse:private] => [{"code":57,"city_uuid":"8a36c731-6094-42d4-aff7-
ae6ddcb5137f","city":"Люберцы","fias_guid":"427b4e19-f221-4abc-8904-
81f7409c1ce3","kladr_code":"5000005000000","country_code":"RU","country":"Россия","region":"Московская
область","region_code":9,"fias_region_guid":"29251dcf-00a1-4e34-98d4-5c47484a36d4","sub_region":"городской округ
Люберцы","longitude":37.898125,"latitude":55.676499,"time_zone":"Europe/Moscow","payment_limit":-1.0}]
[errors:CdekSDK2\Http\ApiResponse:private] => Array
(
)
[status:CdekSDK2\Http\ApiResponse:private] => 200
)
здравствуйте,
вывод списка городов из примера #(https://github.com/cdek-it/sdk2.0/blob/master/docs/index.md#%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-c%D0%BF%D0%B8%D1%81%D0%BA%D0%B0-%D0%B3%D0%BE%D1%80%D0%BE%D0%B4%D0%BE%D0%B2). получаю ошибку:
PHP Fatal error: Uncaught JMS\Serializer\Exception\RuntimeException: You must define a type for CdekSDK2\Dto\CityList::$items.
код программы:
ошибка возникает при присвоении значений переменной $cities, т.е. переменная $cities ничего не получает
переменная $result: