• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/legacy/storagecontroller.php
  • Класс: BitrixDiskBitrix24DiskLegacyStorageController
  • Вызов: StorageController::adjustSnapshotFormat
protected function adjustSnapshotFormat($items)
{
	$apiDiskVersion = Desktop::getApiDiskVersion();
	if ($apiDiskVersion === 0)
	{
		//this is browser.
		return $items;
	}
	if (!($items instanceof SplFixedArray))
	{
		return $items;
	}

	$minVersion = self::MIN_API_DISK_VERSION_FOR_JSON_LIST_IN_SNAPSHOT;
	if ($apiDiskVersion >= $minVersion)
	{
		//ready to work with json list
		if (PHP_VERSION_ID >= 81000)
		{
			return $items;
		}

		return $items->toArray();
	}

	if (PHP_VERSION_ID < 80100)
	{
		return $items;
	}

	//old bdisk version and php 8.1. Need to convert to object instead array.
	$itemsAsArray = $items->toArray();

	return (object)$itemsAsArray;
}