Skip to content

Commit bdfb7b6

Browse files
ib-fsrnecinfobip-ci
andauthored
Update to version 6.0.0 (#70)
* Update to version 6.0.0 --------- Co-authored-by: infobip-ci <[email protected]>
1 parent 52d5a45 commit bdfb7b6

File tree

1,081 files changed

+109206
-25131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,081 files changed

+109206
-25131
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
composer.phar
44
/vendor/
55

6+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
7+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8+
composer.lock
9+
610
# php-cs-fixer cache
711
.php_cs.cache
812
.php-cs-fixer.cache
13+
.php-cs-fixer.php
914

1015
# PHPUnit cache
1116
.phpunit.result.cache
17+
18+
# IDE
19+
.idea

CHANGELOG.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,59 @@ All notable changes to the library will be documented in this file.
44

55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in the [README.md][readme] file.
66

7-
## [ [5.1.5](https://github.com/infobip/infobip-api-php-client/releases/tag/5.1.3) ] - 2024-01-09
7+
## [ [6.0.0](https://github.com/infobip/infobip-api-php-client/releases/tag/6.0.0) ] - 2024-12-09
8+
9+
⚠️ **IMPORTANT NOTE:** This release contains breaking changes! From this point onward PHP version 8.0 is no longer supported. Minimum PHP version required is 8.3.
10+
11+
In this release we updated the library to use the latest version of the Infobip API. We also updated the library to use the latest version of the Symfony components. Minimum Symfony
12+
version required is 7.0.
13+
14+
🎉 **NEW Major Version of `infobip-api-php-client`.**
15+
16+
### Added
17+
* Support for [Infobip Messages API](https://www.infobip.com/docs/api/platform/messages-api).
18+
* Most recent [Infobip Voice API](https://www.infobip.com/docs/api/channels/voice) feature set.
19+
* Most recent [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms) feature set.
20+
* Most recent [Infobip 2FA API](https://www.infobip.com/docs/api/platform/2fa) feature set.
21+
* Most recent [Infobip MMS API](https://www.infobip.com/docs/api/channels/mms) feature set.
22+
* Most recent [Infobip Email API](https://www.infobip.com/docs/api/channels/email) feature set.
23+
* Most recent [Infobip WhatsApp API](https://www.infobip.com/docs/api/channels/whatsapp) feature set.
24+
* Most recent [Infobip Viber API](https://www.infobip.com/docs/api/channels/viber) feature set.
25+
* Most recent [Infobip WebRTC API](https://www.infobip.com/docs/api/channels/webrtc-calls) feature set.
26+
* PHP CS Fixer and PHPStan dev dependencies for code quality checks.
27+
* Additional set of integration tests.
828

929
### Changed
10-
- Updated symfony/serializer dependency to ^5.4
30+
31+
#### Dependencies
32+
* Require PHP version 8.3 or higher.
33+
* Bumped Symfony components to the latest major version.
34+
35+
#### Model changes
36+
* Migration to the new SMS v3 API. Check the [README.md][readme] for updated examples.
37+
* Introduced the new [SmsMessage](Infobip/Model/SmsMessage.php) class to replace `SmsTextualMessage` and `SmsBinaryMessage`, providing a unified structure for SMS messaging.
38+
* Added a content field within `SmsMessage` to define the message content.
39+
This supports both textual and binary messages, which can be created using [SmsTextContent](Infobip/Model/SmsTextContent.php) or [SmsBinaryContent](Infobip/Model/SmsBinaryContent.php), respectively.
40+
* Unified request classes by replacing `SmsAdvancedTextualRequest` and `SmsAdvancedBinaryRequest` with the new [SmsRequest](Infobip/Model/SmsRequest.php) class.
41+
* Consolidated sending functions: use `sendSmsMessages` instead of the `sendSmsMessage` and `sendBinarySmsMessage` functions.
42+
* Across all Call models, the `applicationId` field has been removed and replaced with the `platform` field, as encapsulates platform fields and reflects the current state of the endpoint.
43+
In addition to that, a new required `callsConfigurationId` field has been added.
44+
* Removed delivery time window configuration classes (`SmsDeliveryTimeWindow`, `MmsDeliveryTimeWindow`, `ViberDeliveryTimeWindow`, `CallRoutingAllowedTimeWindow`, `CallsDeliveryTimeWindow`, `SmsDeliveryTimeWindow`, `CallsTimeWindow`) in favor of a unified class: [DeliveryTimeWindow](Infobip/Model/DeliveryTimeWindow.php)
45+
* Removed delivery time configuration classes (`SmsDeliveryTimeFrom`, `SmsDeliveryTimeTo`, `MmsDeliveryTime`, `ViberDeliveryTime`, `CallsTimeWindowPoint`, `WebRtcTimeOfDay`, `CallRoutingAllowedTimeFrom`, `CallRoutingAllowedTimeTo`, `WebRtcTimeOfDay`) in favor of a unified class: [DeliveryTime](Infobip/Model/DeliveryTime.php)
46+
* Removed URL options configuration classes (`MessagesApiUrlOptions`, `ViberUrlOptions`, `WhatsAppUrlOptions`) in favor of a unified class: [UrlOptions](Infobip/Model/UrlOptions.php)
47+
* Removed CPaaS X platform configuration classes (`ViberPlatform`, `MessagesApiPlatform`) in favor of a unified class: [Platform](Infobip/Model/Platform.php)
48+
* Removed delivery day enumeration classes (`SmsDeliveryDay`, `MmsDeliveryDay`, `CallsDeliveryDay`, `CallRoutingAllowedDay`) in favor of a unified class: [DeliveryDay](Infobip/Model/DeliveryDay.php)
49+
* Removed validity period configuration classes (`ViberValidityPeriod`, `MessagesApiValidityPeriod`) in favor of a unified class: [ValidityPeriod](Infobip/Model/ValidityPeriod.php)
50+
* Removed validity period time unit enumeration classes (`ViberValidityPeriodTimeUnit`, `MessagesApiValidityPeriodTimeUnit`) in favor of a unified class: [ValidityPeriodTimeUnit](Infobip/Model/ValidityPeriodTimeUnit.php)
51+
* Removed `ModelInterface` since it's no longer needed and not used in serialization anymore.
52+
53+
### Fixed
54+
- Sending Email to multiple recipients.
55+
56+
## [ [5.1.4](https://github.com/infobip/infobip-api-php-client/releases/tag/5.1.4) ] - 2023-06-19
57+
58+
### Fixed
59+
- Update composer.json to match the package version.
1160

1261
## [ [5.1.3](https://github.com/infobip/infobip-api-php-client/releases/tag/5.1.3) ] - 2023-06-19
1362

Infobip/Api/ApiTrait.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// phpcs:ignorefile
44

55
/**
6-
*
7-
* PHP version 8.0
6+
* ApiTrait
7+
* PHP version 8.3
88
*
99
* @category Trait
1010
* @package Infobip
@@ -30,7 +30,6 @@
3030

3131
use Infobip\SplFileObjectNormalizer;
3232
use Psr\Http\Message\StreamInterface;
33-
use RuntimeException;
3433
use SplFileObject;
3534
use Symfony\Component\Validator\Constraints as Assert;
3635

@@ -66,24 +65,16 @@ private function deserialize(mixed $response, string $type, array $responseHeade
6665
return $this->objectSerializer->deserialize((string)$response, $type, $responseHeaders);
6766
}
6867

69-
private function addParamConstraints(array $paramConstraints, array &$validationConstraints): void
70-
{
71-
foreach ($paramConstraints as $key => $constraints) {
72-
if (!empty($constraints)) {
73-
$validationConstraints[$key] = new Assert\All($constraints);
74-
}
75-
}
76-
}
7768

7869
/**
7970
* @internal
8071
*/
81-
private function validateParams(array $allData, array $validationConstraints): void
72+
private function validateParams(array $allData, Assert\Collection $validationConstraints): void
8273
{
83-
if (!empty($validationConstraints)) {
74+
if (!empty($validationConstraints -> fields)) {
8475
$dataToValidate = [];
8576

86-
foreach (\array_keys($validationConstraints) as $constraintKey) {
77+
foreach (\array_keys($validationConstraints -> fields) as $constraintKey) {
8778
$dataToValidate[$constraintKey] = $allData[$constraintKey];
8879
}
8980

0 commit comments

Comments
 (0)