diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d78745..0598874 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.9.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c732896..d7af301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.9.1 (2026-03-04) + +Full Changelog: [v0.9.0...v0.9.1](https://github.com/moderation-api/sdk-php/compare/v0.9.0...v0.9.1) + +### Chores + +* **internal:** codegen related update ([5ef0410](https://github.com/moderation-api/sdk-php/commit/5ef04106c2b4ab4c3d3eeff8c13798016aefca5a)) + ## 0.9.0 (2026-03-03) Full Changelog: [v0.8.0...v0.9.0](https://github.com/moderation-api/sdk-php/compare/v0.8.0...v0.9.0) diff --git a/README.md b/README.md index 9f136c2..09efaef 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The REST API documentation can be found on [docs.moderationapi.com](https://docs ``` -composer require "moderation-api/sdk-php 0.9.0" +composer require "moderation-api/sdk-php 0.9.1" ``` diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 17c4298..b22081d 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -170,6 +170,37 @@ private static function tryConvert(Converter|ConverterSource|string $target, mix return $value; + case 'DateTimeInterface': + case 'DateTimeImmutable': + if (is_string($value)) { + try { + ++$state->maybe; + + return new \DateTimeImmutable($value); + } catch (\Exception) { + --$state->maybe; + } + } + + ++$state->no; + + return $value; + + case 'DateTime': + if (is_string($value)) { + try { + ++$state->maybe; + + return new \DateTime($value); + } catch (\Exception) { + --$state->maybe; + } + } + + ++$state->no; + + return $value; + default: ++$state->no; diff --git a/src/Version.php b/src/Version.php index 9441031..6580b08 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ModerationAPI; // x-release-please-start-version -const VERSION = '0.9.0'; +const VERSION = '0.9.1'; // x-release-please-end