1.8.0
Added
- Added service
Services\CRM\Type\Service\Typewith support methods,
see crm.type.* methods:fieldsmethod retrieves information about the custom fields of the smart process settingsaddmethod creates a new SPAupdateupdates an existing SPA by its identifier idgetmethod retrieves information about the SPA with the identifier idgetByEntityTypeIdmethod retrieves information about the SPA with the smart process type identifier entityTypeIdlistGet a list of custom types crm.type.listdeleteThis method deletes an existing smart process by the identifier id
- For
AbstractCrmItemadded methodgetSmartProcessItemto get smart process item, see details - Added support for events, see details
onCrmContactAddonCrmContactUpdateonCrmContactDelete
- Added separated methods
RemoteEventsFactory::createandRemoteEventsFactory::validatefor create and validate incoming
events, see details - Added comprehensive unit tests for
RemoteEventsFactory::createandRemoteEventsFactory::validatemethods with 14 test cases covering:- Event creation for supported event types (CRM Contact Add, Application Install)
- Handling of unsupported events
- Request validation
- Token validation with
Bitrix24AccountInterface - Special handling for
OnApplicationInstallevents
- Updated
ContactPersonInterfaceimplementation, see details with new methods:- Added
isEmailVerified(): boolto check email verification status - Added
isMobilePhoneVerified(): boolto check mobile phone verification status - Changed
changeEmail(?string $email)signature (removed optional$isEmailVerifiedparameter) - Changed
changeMobilePhone(?PhoneNumber $phoneNumber)signature (removed optional$isMobilePhoneVerifiedparameter) - Added
getUserAgentInfo(): UserAgentInfoto replace separate methods for user agent data
- Added
- Added comprehensive unit tests for
UTMsclass with 28 test cases covering:- Constructor with all, partial, and default parameters
- URL parsing with various UTM parameter combinations
- Case-insensitive parameter handling
- URL encoding and special characters
- Real-world URL examples (Google Ads, Facebook, Email, Twitter, LinkedIn, etc.)
- Added comprehensive unit tests for
UserAgentInfoclass with 33 test cases covering:- Constructor with IP addresses (IPv4, IPv6, localhost)
- Various user agent strings (Chrome, Firefox, Safari, Edge, mobile browsers)
- UTM extraction from referrer URLs
- Real-world scenarios with complete user tracking data
- Added support for dynamic OAuth server selection based on regional endpoints:
Credentialsclass now supportsEndpointsobject withauthServerUrlandclientUrl- New methods in
Credentials:getEndpoints(),getOauthServerUrl(),getClientUrl(),
changeDomainUrl(), see details Endpointsclass gainedchangeClientUrl()method to create new instance with updated client URL (immutable)RenewedAuthTokengainedgetEndpoints()method to createEndpointsobject from server responseCoreBuildergainedwithEndpoints()andwithOauthServerUrl()methods for explicit endpoint configuration- OAuth server URL is automatically extracted from
server_endpointfield in API responses - Default OAuth server remains
https://oauth.bitrix.infofor backward compatibility
- Added comprehensive unit tests for
Endpointsclass with 29 test cases covering:- Constructor validation for client and auth server URLs
getClientUrl()andgetAuthServerUrl()methodschangeClientUrl()method with immutability checksinitFromArray()static factory method with validation- URL format validation (HTTP/HTTPS, ports, paths, subdomains)
- Error handling for invalid URLs and missing required fields
- Automatic addition of
https://protocol when missing from client URL - Added automatic protocol fallback in
Endpointsconstructor: if client URL is provided without protocol (e.g.,example.bitrix24.com),https://is automatically added
Changed
- Breaking changes in
ContactPersonInterfacemethod signatures:changeEmail(?string $email)- removed second parameter?bool $isEmailVerified. Migration path: callmarkEmailAsVerified()separately after
changeEmail()if email needs to be verifiedchangeMobilePhone(?PhoneNumber $phoneNumber)- removed second parameter?bool $isMobilePhoneVerified. Migration path: call
markMobilePhoneAsVerified()separately afterchangeMobilePhone()if phone needs to be verified- Replaced
getUserAgent(),getUserAgentReferer(),getUserAgentIp()methods with singlegetUserAgentInfo(): UserAgentInfomethod that returns
complete user agent information object. Migration path: use$info->userAgent,$info->referrer,$info->ipproperties instead
- Updated
RemoteEventsFactory::validate()method signature fromvalidate(EventInterface $event, string $applicationToken)to
validate(Bitrix24AccountInterface $bitrix24Account, EventInterface $event). Now usesBitrix24AccountInterface::isApplicationTokenValid()for token
validation instead of direct string comparison - Docker configuration updated to PHP 8.4 - Development environment now uses PHP 8.4.14 (docker/php-cli/Dockerfile):
- Upgraded from PHP 8.3 to PHP 8.4 base image (
php:8.4-cli-bookworm) - Updated Composer to version 2.8
- Added PHP extension installer v2.4 from mlocati for easier extension management
- Added new PHP extensions:
amqp,excimer,opcache,pcntl,yaml,zip - Changed base OS from Alpine to Debian Bookworm for better compatibility
- Implemented multi-stage Docker build for optimized image size
- Added proper user/group ID mapping for www-data user (UID/GID 10001)
- Set proper working directory ownership and non-root user execution
- Upgraded from PHP 8.3 to PHP 8.4 base image (
- PHP 8.4 compatibility improvements:
- Rector configuration updated to use
LevelSetList::UP_TO_PHP_84for PHP 8.4 feature detection - PHPUnit configuration updated to PHPUnit 11.0 attribute set (
PHPUnitSetList::PHPUNIT_110) - Fixed all implicitly nullable parameter deprecation warnings (8 occurrences)
- Fixed PHPStan internal errors with
random_int()range handling
- Rector configuration updated to use
- OAuth server selection made dynamic:
ApiClientnow usesCredentials::getOauthServerUrl()instead of hardcoded constantCoreautomatically updates endpoints in credentials when receiving renewed auth tokens- OAuth server URL is preserved and updated from
server_endpointin token refresh responses - Existing code continues to work without changes (backward compatible)
Fixed
- Fixed wrong offset in
ItemsResultsee details - Fixed wrong exception for method
crm.item.get, now itItemNotFoundExceptionsee details - Fixed added type
projectin enumPortalLicenseFamilysee details - Fixed errors in
ContactPersonRepositoryInterfaceTest, see details - Breaking change: Fixed method signature
Credentials::createFromOAuth()- third parameter changed fromstring $domainUrltoEndpoints $endpoints
object- Migration: Replace
Credentials::createFromOAuth($authToken, $appProfile, 'https://example.com')with
Credentials::createFromOAuth($authToken, $appProfile, new Endpoints('https://example.com', 'https://oauth.bitrix.info/')) - Updated all unit and integration tests to use new signature
- Migration: Replace
- Fixed bug in
Endpointsclass constructor (line 35) - validation should check$this->authServerUrlinstead of$authServerUrlparameter - Fixed unit tests in
CredentialsTest.phpto properly instantiateEndpointsobjects - Fixed unit tests in
CoreTest.phpintegration test to useEndpointsobject
Deprecated
- Method
RemoteEventsFactory::createEventmarked as deprecated, useRemoteEventsFactory::createandRemoteEventsFactory::validateinstead
Statistics
Bitrix24 API-methods count: 1162
Supported in bitrix24-php-sdk methods count: 639
Coverage percentage: 54.99% 🚀
Supported in bitrix24-php-sdk methods with batch wrapper count: 91
New Contributors
- @maximyugov made their first contribution in #295