bitrix24/b24phpsdk
Bitrix24 PHP SDK for working with the Bitrix24 REST API from Laravel or plain PHP. Provides typed clients, authentication helpers, API method wrappers, pagination, and webhook/OAuth support to simplify integrating CRM, tasks, chats, and other Bitrix24 modules.
Add SDK support for the Bitrix24 REST method im.disk.folder.get in a minimal way that matches the scope of issue #435.
In scope:
src/Services/IM/Disk/Service/Disk.phpim.disk.folder.getIMServiceBuilder::disk()make test-integration-im-disk targetCHANGELOG.md entry under 3.2.0 – UNRELEASED / ### AddedOut of scope:
im.disk.* methodsCreate Bitrix24\SDK\Services\IM\Disk\Service\Disk as a regular AbstractService subclass with:
#[ApiServiceMetadata(new Scope(['im']))]getFolderId(?int $chatId = null, ?string $dialogId = null): FolderIdResultThe method calls im.disk.folder.get and maps optional request parameters to CHAT_ID / DIALOG_ID.
Bitrix24 requires at least one of these parameters, but the SDK method can forward them as nullable values and leave cross-field validation to the API, matching existing service patterns.
Because the response shape is result.ID, add a dedicated result wrapper instead of relying on a non-existent generic integer result class:
src/Services/IM/Disk/Result/FolderIdResult.phpFolderIdResult::getId(): intThis keeps the implementation aligned with the existing service pattern in the SDK while avoiding speculative expansion for future im.disk.* methods.
Extend Bitrix24\SDK\Services\IM\IMServiceBuilder with:
disk(): \Bitrix24\SDK\Services\IM\Disk\Service\DiskThe accessor should follow the same caching behavior already used by notify() and placements().
Unit coverage:
tests/Unit/Services/IM/IMServiceBuilderTest.php with an assertion that disk() returns the new service and is cachedtests/Unit/Services/IM/Disk/Service/DiskTest.php to verify:
im.disk.folder.getCHAT_ID / DIALOG_ID parameter mappingFolderIdResultIntegration coverage:
tests/Integration/Services/IM/Disk/Service/DiskTest.phpFactory::getServiceBuilder()->getIMScope()->disk()->getFolderId(dialogId: 'chat...') returns a positive folder idTest execution wiring:
phpunit.xml.dist for the new integration test pathmake test-integration-im-disk to run only that suiteNo custom error handling is needed. The new service should reuse the existing transport and API exception flow provided by AbstractService and Core.
Minimum verification for the implementation phase:
im.disk.folder.get#435result.ID, so the new custom FolderIdResult must read the nested key correctly.How can I help you explore Laravel packages today?