Skip to content

Commit

Permalink
Update to version 6.0.0 (#70)
Browse files Browse the repository at this point in the history
* Update to version 6.0.0

---------

Co-authored-by: infobip-ci <[email protected]>
  • Loading branch information
ib-fsrnec and infobip-ci authored Dec 9, 2024
1 parent 52d5a45 commit bdfb7b6
Show file tree
Hide file tree
Showing 1,081 changed files with 109,206 additions and 25,131 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock

# php-cs-fixer cache
.php_cs.cache
.php-cs-fixer.cache
.php-cs-fixer.php

# PHPUnit cache
.phpunit.result.cache

# IDE
.idea
53 changes: 51 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,59 @@ All notable changes to the library will be documented in this file.

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.

## [ [5.1.5](https://github.com/infobip/infobip-api-php-client/releases/tag/5.1.3) ] - 2024-01-09
## [ [6.0.0](https://github.com/infobip/infobip-api-php-client/releases/tag/6.0.0) ] - 2024-12-09

⚠️ **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.

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
version required is 7.0.

🎉 **NEW Major Version of `infobip-api-php-client`.**

### Added
* Support for [Infobip Messages API](https://www.infobip.com/docs/api/platform/messages-api).
* Most recent [Infobip Voice API](https://www.infobip.com/docs/api/channels/voice) feature set.
* Most recent [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms) feature set.
* Most recent [Infobip 2FA API](https://www.infobip.com/docs/api/platform/2fa) feature set.
* Most recent [Infobip MMS API](https://www.infobip.com/docs/api/channels/mms) feature set.
* Most recent [Infobip Email API](https://www.infobip.com/docs/api/channels/email) feature set.
* Most recent [Infobip WhatsApp API](https://www.infobip.com/docs/api/channels/whatsapp) feature set.
* Most recent [Infobip Viber API](https://www.infobip.com/docs/api/channels/viber) feature set.
* Most recent [Infobip WebRTC API](https://www.infobip.com/docs/api/channels/webrtc-calls) feature set.
* PHP CS Fixer and PHPStan dev dependencies for code quality checks.
* Additional set of integration tests.

### Changed
- Updated symfony/serializer dependency to ^5.4

#### Dependencies
* Require PHP version 8.3 or higher.
* Bumped Symfony components to the latest major version.

#### Model changes
* Migration to the new SMS v3 API. Check the [README.md][readme] for updated examples.
* Introduced the new [SmsMessage](Infobip/Model/SmsMessage.php) class to replace `SmsTextualMessage` and `SmsBinaryMessage`, providing a unified structure for SMS messaging.
* Added a content field within `SmsMessage` to define the message content.
This supports both textual and binary messages, which can be created using [SmsTextContent](Infobip/Model/SmsTextContent.php) or [SmsBinaryContent](Infobip/Model/SmsBinaryContent.php), respectively.
* Unified request classes by replacing `SmsAdvancedTextualRequest` and `SmsAdvancedBinaryRequest` with the new [SmsRequest](Infobip/Model/SmsRequest.php) class.
* Consolidated sending functions: use `sendSmsMessages` instead of the `sendSmsMessage` and `sendBinarySmsMessage` functions.
* 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.
In addition to that, a new required `callsConfigurationId` field has been added.
* Removed delivery time window configuration classes (`SmsDeliveryTimeWindow`, `MmsDeliveryTimeWindow`, `ViberDeliveryTimeWindow`, `CallRoutingAllowedTimeWindow`, `CallsDeliveryTimeWindow`, `SmsDeliveryTimeWindow`, `CallsTimeWindow`) in favor of a unified class: [DeliveryTimeWindow](Infobip/Model/DeliveryTimeWindow.php)
* 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)
* Removed URL options configuration classes (`MessagesApiUrlOptions`, `ViberUrlOptions`, `WhatsAppUrlOptions`) in favor of a unified class: [UrlOptions](Infobip/Model/UrlOptions.php)
* Removed CPaaS X platform configuration classes (`ViberPlatform`, `MessagesApiPlatform`) in favor of a unified class: [Platform](Infobip/Model/Platform.php)
* Removed delivery day enumeration classes (`SmsDeliveryDay`, `MmsDeliveryDay`, `CallsDeliveryDay`, `CallRoutingAllowedDay`) in favor of a unified class: [DeliveryDay](Infobip/Model/DeliveryDay.php)
* Removed validity period configuration classes (`ViberValidityPeriod`, `MessagesApiValidityPeriod`) in favor of a unified class: [ValidityPeriod](Infobip/Model/ValidityPeriod.php)
* Removed validity period time unit enumeration classes (`ViberValidityPeriodTimeUnit`, `MessagesApiValidityPeriodTimeUnit`) in favor of a unified class: [ValidityPeriodTimeUnit](Infobip/Model/ValidityPeriodTimeUnit.php)
* Removed `ModelInterface` since it's no longer needed and not used in serialization anymore.

### Fixed
- Sending Email to multiple recipients.

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

### Fixed
- Update composer.json to match the package version.

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

Expand Down
19 changes: 5 additions & 14 deletions Infobip/Api/ApiTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// phpcs:ignorefile

/**
*
* PHP version 8.0
* ApiTrait
* PHP version 8.3
*
* @category Trait
* @package Infobip
Expand All @@ -30,7 +30,6 @@

use Infobip\SplFileObjectNormalizer;
use Psr\Http\Message\StreamInterface;
use RuntimeException;
use SplFileObject;
use Symfony\Component\Validator\Constraints as Assert;

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

private function addParamConstraints(array $paramConstraints, array &$validationConstraints): void
{
foreach ($paramConstraints as $key => $constraints) {
if (!empty($constraints)) {
$validationConstraints[$key] = new Assert\All($constraints);
}
}
}

/**
* @internal
*/
private function validateParams(array $allData, array $validationConstraints): void
private function validateParams(array $allData, Assert\Collection $validationConstraints): void
{
if (!empty($validationConstraints)) {
if (!empty($validationConstraints -> fields)) {
$dataToValidate = [];

foreach (\array_keys($validationConstraints) as $constraintKey) {
foreach (\array_keys($validationConstraints -> fields) as $constraintKey) {
$dataToValidate[$constraintKey] = $allData[$constraintKey];
}

Expand Down
Loading

0 comments on commit bdfb7b6

Please sign in to comment.