From 19d6107cb0b15cefc14cbe1fdedb0c752535ed7d Mon Sep 17 00:00:00 2001 From: David Badura Date: Sat, 28 Feb 2026 10:25:35 +0100 Subject: [PATCH] mark stack hydrator experimental --- src/CoreExtension.php | 1 + src/Extension.php | 1 + src/Extension/Cryptography/Attribute/DataSubjectId.php | 1 + src/Extension/Cryptography/Attribute/SensitiveData.php | 1 + src/Extension/Cryptography/BaseCryptographer.php | 1 + src/Extension/Cryptography/Cipher/Cipher.php | 1 + src/Extension/Cryptography/Cipher/CipherKey.php | 1 + src/Extension/Cryptography/Cipher/CipherKeyFactory.php | 1 + src/Extension/Cryptography/Cipher/CreateCipherKeyFailed.php | 1 + src/Extension/Cryptography/Cipher/DecryptionFailed.php | 1 + src/Extension/Cryptography/Cipher/EncryptionFailed.php | 1 + src/Extension/Cryptography/Cipher/MethodNotSupported.php | 1 + src/Extension/Cryptography/Cipher/OpensslCipher.php | 1 + src/Extension/Cryptography/Cipher/OpensslCipherKeyFactory.php | 1 + src/Extension/Cryptography/Cryptographer.php | 1 + src/Extension/Cryptography/CryptographyExtension.php | 1 + src/Extension/Cryptography/CryptographyMetadataEnricher.php | 1 + src/Extension/Cryptography/CryptographyMiddleware.php | 1 + src/Extension/Cryptography/DuplicateSubjectIdIdentifier.php | 1 + src/Extension/Cryptography/MissingSubjectId.php | 1 + src/Extension/Cryptography/MissingSubjectIdForField.php | 1 + src/Extension/Cryptography/SensitiveDataInfo.php | 1 + src/Extension/Cryptography/Store/CipherKeyNotExists.php | 1 + src/Extension/Cryptography/Store/CipherKeyStore.php | 1 + src/Extension/Cryptography/Store/InMemoryCipherKeyStore.php | 1 + src/Extension/Cryptography/SubjectIdAndSensitiveDataConflict.php | 1 + src/Extension/Cryptography/SubjectIdFieldMapping.php | 1 + src/Extension/Cryptography/SubjectIds.php | 1 + src/Extension/Cryptography/UnsupportedSubjectId.php | 1 + src/Extension/Lifecycle/Attribute/PostExtract.php | 1 + src/Extension/Lifecycle/Attribute/PostHydrate.php | 1 + src/Extension/Lifecycle/Attribute/PreExtract.php | 1 + src/Extension/Lifecycle/Attribute/PreHydrate.php | 1 + src/Extension/Lifecycle/Lifecycle.php | 1 + src/Extension/Lifecycle/LifecycleExtension.php | 1 + src/Extension/Lifecycle/LifecycleMetadataEnricher.php | 1 + src/Extension/Lifecycle/LifecycleMiddleware.php | 1 + src/Middleware/Middleware.php | 1 + src/Middleware/NoMoreMiddleware.php | 1 + src/Middleware/Stack.php | 1 + src/Middleware/TransformMiddleware.php | 1 + src/StackHydrator.php | 1 + src/StackHydratorBuilder.php | 1 + 43 files changed, 43 insertions(+) diff --git a/src/CoreExtension.php b/src/CoreExtension.php index 81cce0df..9ff16064 100644 --- a/src/CoreExtension.php +++ b/src/CoreExtension.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\Guesser\BuiltInGuesser; use Patchlevel\Hydrator\Middleware\TransformMiddleware; +/** @experimental */ final class CoreExtension implements Extension { public function configure(StackHydratorBuilder $builder): void diff --git a/src/Extension.php b/src/Extension.php index 723e3052..3b0e83f1 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator; +/** @experimental */ interface Extension { public function configure(StackHydratorBuilder $builder): void; diff --git a/src/Extension/Cryptography/Attribute/DataSubjectId.php b/src/Extension/Cryptography/Attribute/DataSubjectId.php index 6c3443b6..8b65ac06 100644 --- a/src/Extension/Cryptography/Attribute/DataSubjectId.php +++ b/src/Extension/Cryptography/Attribute/DataSubjectId.php @@ -6,6 +6,7 @@ use Attribute; +/** @experimental */ #[Attribute(Attribute::TARGET_PROPERTY)] final class DataSubjectId { diff --git a/src/Extension/Cryptography/Attribute/SensitiveData.php b/src/Extension/Cryptography/Attribute/SensitiveData.php index 2e0c734e..4e004ab5 100644 --- a/src/Extension/Cryptography/Attribute/SensitiveData.php +++ b/src/Extension/Cryptography/Attribute/SensitiveData.php @@ -7,6 +7,7 @@ use Attribute; use InvalidArgumentException; +/** @experimental */ #[Attribute(Attribute::TARGET_PROPERTY)] final class SensitiveData { diff --git a/src/Extension/Cryptography/BaseCryptographer.php b/src/Extension/Cryptography/BaseCryptographer.php index 1419249a..8769c6b2 100644 --- a/src/Extension/Cryptography/BaseCryptographer.php +++ b/src/Extension/Cryptography/BaseCryptographer.php @@ -20,6 +20,7 @@ use function is_array; /** + * @experimental * @phpstan-type EncryptedDataV1 array{ * __enc: 'v1', * data: non-empty-string, diff --git a/src/Extension/Cryptography/Cipher/Cipher.php b/src/Extension/Cryptography/Cipher/Cipher.php index 9652c851..03f38ec8 100644 --- a/src/Extension/Cryptography/Cipher/Cipher.php +++ b/src/Extension/Cryptography/Cipher/Cipher.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Cryptography\Cipher; +/** @experimental */ interface Cipher { /** diff --git a/src/Extension/Cryptography/Cipher/CipherKey.php b/src/Extension/Cryptography/Cipher/CipherKey.php index 52e7e354..ced9c9aa 100644 --- a/src/Extension/Cryptography/Cipher/CipherKey.php +++ b/src/Extension/Cryptography/Cipher/CipherKey.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Cryptography\Cipher; +/** @experimental */ final class CipherKey { /** diff --git a/src/Extension/Cryptography/Cipher/CipherKeyFactory.php b/src/Extension/Cryptography/Cipher/CipherKeyFactory.php index 2eeb4935..85050f1f 100644 --- a/src/Extension/Cryptography/Cipher/CipherKeyFactory.php +++ b/src/Extension/Cryptography/Cipher/CipherKeyFactory.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Cryptography\Cipher; +/** @experimental */ interface CipherKeyFactory { /** @throws CreateCipherKeyFailed */ diff --git a/src/Extension/Cryptography/Cipher/CreateCipherKeyFailed.php b/src/Extension/Cryptography/Cipher/CreateCipherKeyFailed.php index b54acedc..60f2fcf2 100644 --- a/src/Extension/Cryptography/Cipher/CreateCipherKeyFailed.php +++ b/src/Extension/Cryptography/Cipher/CreateCipherKeyFailed.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\HydratorException; use RuntimeException; +/** @experimental */ final class CreateCipherKeyFailed extends RuntimeException implements HydratorException { public function __construct() diff --git a/src/Extension/Cryptography/Cipher/DecryptionFailed.php b/src/Extension/Cryptography/Cipher/DecryptionFailed.php index 56e890d8..8b7059e8 100644 --- a/src/Extension/Cryptography/Cipher/DecryptionFailed.php +++ b/src/Extension/Cryptography/Cipher/DecryptionFailed.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\HydratorException; use RuntimeException; +/** @experimental */ final class DecryptionFailed extends RuntimeException implements HydratorException { public function __construct() diff --git a/src/Extension/Cryptography/Cipher/EncryptionFailed.php b/src/Extension/Cryptography/Cipher/EncryptionFailed.php index 43f19481..65bd1fb4 100644 --- a/src/Extension/Cryptography/Cipher/EncryptionFailed.php +++ b/src/Extension/Cryptography/Cipher/EncryptionFailed.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\HydratorException; use RuntimeException; +/** @experimental */ final class EncryptionFailed extends RuntimeException implements HydratorException { public function __construct() diff --git a/src/Extension/Cryptography/Cipher/MethodNotSupported.php b/src/Extension/Cryptography/Cipher/MethodNotSupported.php index d3512904..2b24978e 100644 --- a/src/Extension/Cryptography/Cipher/MethodNotSupported.php +++ b/src/Extension/Cryptography/Cipher/MethodNotSupported.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class MethodNotSupported extends RuntimeException implements HydratorException { public function __construct(string $method) diff --git a/src/Extension/Cryptography/Cipher/OpensslCipher.php b/src/Extension/Cryptography/Cipher/OpensslCipher.php index e37235a5..2fd55afa 100644 --- a/src/Extension/Cryptography/Cipher/OpensslCipher.php +++ b/src/Extension/Cryptography/Cipher/OpensslCipher.php @@ -15,6 +15,7 @@ use const JSON_THROW_ON_ERROR; +/** @experimental */ final class OpensslCipher implements Cipher { /** @return non-empty-string */ diff --git a/src/Extension/Cryptography/Cipher/OpensslCipherKeyFactory.php b/src/Extension/Cryptography/Cipher/OpensslCipherKeyFactory.php index 3e30a638..67f1a5b0 100644 --- a/src/Extension/Cryptography/Cipher/OpensslCipherKeyFactory.php +++ b/src/Extension/Cryptography/Cipher/OpensslCipherKeyFactory.php @@ -11,6 +11,7 @@ use function openssl_get_cipher_methods; use function openssl_random_pseudo_bytes; +/** @experimental */ final class OpensslCipherKeyFactory implements CipherKeyFactory { public const DEFAULT_METHOD = 'aes128'; diff --git a/src/Extension/Cryptography/Cryptographer.php b/src/Extension/Cryptography/Cryptographer.php index b540ec7d..054dc4a6 100644 --- a/src/Extension/Cryptography/Cryptographer.php +++ b/src/Extension/Cryptography/Cryptographer.php @@ -8,6 +8,7 @@ use Patchlevel\Hydrator\Extension\Cryptography\Cipher\EncryptionFailed; use Patchlevel\Hydrator\Extension\Cryptography\Store\CipherKeyNotExists; +/** @experimental */ interface Cryptographer { /** @throws EncryptionFailed */ diff --git a/src/Extension/Cryptography/CryptographyExtension.php b/src/Extension/Cryptography/CryptographyExtension.php index 0274a9d6..ea8a6a21 100644 --- a/src/Extension/Cryptography/CryptographyExtension.php +++ b/src/Extension/Cryptography/CryptographyExtension.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\Extension; use Patchlevel\Hydrator\StackHydratorBuilder; +/** @experimental */ final class CryptographyExtension implements Extension { public function __construct( diff --git a/src/Extension/Cryptography/CryptographyMetadataEnricher.php b/src/Extension/Cryptography/CryptographyMetadataEnricher.php index 6357d5a4..794ccd0f 100644 --- a/src/Extension/Cryptography/CryptographyMetadataEnricher.php +++ b/src/Extension/Cryptography/CryptographyMetadataEnricher.php @@ -12,6 +12,7 @@ use function array_key_exists; +/** @experimental */ final class CryptographyMetadataEnricher implements MetadataEnricher { public function enrich(ClassMetadata $classMetadata): void diff --git a/src/Extension/Cryptography/CryptographyMiddleware.php b/src/Extension/Cryptography/CryptographyMiddleware.php index 304ce220..60616e59 100644 --- a/src/Extension/Cryptography/CryptographyMiddleware.php +++ b/src/Extension/Cryptography/CryptographyMiddleware.php @@ -19,6 +19,7 @@ use function is_int; use function is_string; +/** @experimental */ final class CryptographyMiddleware implements Middleware { public function __construct( diff --git a/src/Extension/Cryptography/DuplicateSubjectIdIdentifier.php b/src/Extension/Cryptography/DuplicateSubjectIdIdentifier.php index 91d3a034..6a93822c 100644 --- a/src/Extension/Cryptography/DuplicateSubjectIdIdentifier.php +++ b/src/Extension/Cryptography/DuplicateSubjectIdIdentifier.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class DuplicateSubjectIdIdentifier extends RuntimeException implements MetadataException { /** @param class-string $class */ diff --git a/src/Extension/Cryptography/MissingSubjectId.php b/src/Extension/Cryptography/MissingSubjectId.php index df8a7c32..d09db6c7 100644 --- a/src/Extension/Cryptography/MissingSubjectId.php +++ b/src/Extension/Cryptography/MissingSubjectId.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class MissingSubjectId extends RuntimeException implements HydratorException { public function __construct(string $name) diff --git a/src/Extension/Cryptography/MissingSubjectIdForField.php b/src/Extension/Cryptography/MissingSubjectIdForField.php index afc0a304..a74f1986 100644 --- a/src/Extension/Cryptography/MissingSubjectIdForField.php +++ b/src/Extension/Cryptography/MissingSubjectIdForField.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class MissingSubjectIdForField extends RuntimeException implements HydratorException { /** @param class-string $class */ diff --git a/src/Extension/Cryptography/SensitiveDataInfo.php b/src/Extension/Cryptography/SensitiveDataInfo.php index 7f00c3f4..af3990be 100644 --- a/src/Extension/Cryptography/SensitiveDataInfo.php +++ b/src/Extension/Cryptography/SensitiveDataInfo.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Cryptography; +/** @experimental */ final class SensitiveDataInfo { public function __construct( diff --git a/src/Extension/Cryptography/Store/CipherKeyNotExists.php b/src/Extension/Cryptography/Store/CipherKeyNotExists.php index 1b6d7adc..8679caf9 100644 --- a/src/Extension/Cryptography/Store/CipherKeyNotExists.php +++ b/src/Extension/Cryptography/Store/CipherKeyNotExists.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class CipherKeyNotExists extends RuntimeException implements HydratorException { public function __construct(string $id) diff --git a/src/Extension/Cryptography/Store/CipherKeyStore.php b/src/Extension/Cryptography/Store/CipherKeyStore.php index 5f0541f9..fe589f28 100644 --- a/src/Extension/Cryptography/Store/CipherKeyStore.php +++ b/src/Extension/Cryptography/Store/CipherKeyStore.php @@ -6,6 +6,7 @@ use Patchlevel\Hydrator\Extension\Cryptography\Cipher\CipherKey; +/** @experimental */ interface CipherKeyStore { /** @throws CipherKeyNotExists */ diff --git a/src/Extension/Cryptography/Store/InMemoryCipherKeyStore.php b/src/Extension/Cryptography/Store/InMemoryCipherKeyStore.php index aa0ea334..dd328233 100644 --- a/src/Extension/Cryptography/Store/InMemoryCipherKeyStore.php +++ b/src/Extension/Cryptography/Store/InMemoryCipherKeyStore.php @@ -6,6 +6,7 @@ use Patchlevel\Hydrator\Extension\Cryptography\Cipher\CipherKey; +/** @experimental */ final class InMemoryCipherKeyStore implements CipherKeyStore { /** @var array */ diff --git a/src/Extension/Cryptography/SubjectIdAndSensitiveDataConflict.php b/src/Extension/Cryptography/SubjectIdAndSensitiveDataConflict.php index 265ff6c0..69cdca84 100644 --- a/src/Extension/Cryptography/SubjectIdAndSensitiveDataConflict.php +++ b/src/Extension/Cryptography/SubjectIdAndSensitiveDataConflict.php @@ -9,6 +9,7 @@ use function sprintf; +/** @experimental */ final class SubjectIdAndSensitiveDataConflict extends RuntimeException implements MetadataException { /** @param class-string $class */ diff --git a/src/Extension/Cryptography/SubjectIdFieldMapping.php b/src/Extension/Cryptography/SubjectIdFieldMapping.php index 5aa9b9b8..ffef5c47 100644 --- a/src/Extension/Cryptography/SubjectIdFieldMapping.php +++ b/src/Extension/Cryptography/SubjectIdFieldMapping.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Cryptography; +/** @experimental */ final class SubjectIdFieldMapping { /** @param array $nameToField */ diff --git a/src/Extension/Cryptography/SubjectIds.php b/src/Extension/Cryptography/SubjectIds.php index 12d6d730..ca1df081 100644 --- a/src/Extension/Cryptography/SubjectIds.php +++ b/src/Extension/Cryptography/SubjectIds.php @@ -6,6 +6,7 @@ use function array_merge; +/** @experimental */ final class SubjectIds { /** @param array $subjectIds */ diff --git a/src/Extension/Cryptography/UnsupportedSubjectId.php b/src/Extension/Cryptography/UnsupportedSubjectId.php index 13fb8e43..ad739a38 100644 --- a/src/Extension/Cryptography/UnsupportedSubjectId.php +++ b/src/Extension/Cryptography/UnsupportedSubjectId.php @@ -10,6 +10,7 @@ use function get_debug_type; use function sprintf; +/** @experimental */ final class UnsupportedSubjectId extends RuntimeException implements HydratorException { public function __construct(string $class, string $fieldName, mixed $subjectId) diff --git a/src/Extension/Lifecycle/Attribute/PostExtract.php b/src/Extension/Lifecycle/Attribute/PostExtract.php index 6cd5810e..afb09110 100644 --- a/src/Extension/Lifecycle/Attribute/PostExtract.php +++ b/src/Extension/Lifecycle/Attribute/PostExtract.php @@ -6,6 +6,7 @@ use Attribute; +/** @experimental */ #[Attribute(Attribute::TARGET_METHOD)] final class PostExtract { diff --git a/src/Extension/Lifecycle/Attribute/PostHydrate.php b/src/Extension/Lifecycle/Attribute/PostHydrate.php index d15bba32..f4599c6c 100644 --- a/src/Extension/Lifecycle/Attribute/PostHydrate.php +++ b/src/Extension/Lifecycle/Attribute/PostHydrate.php @@ -6,6 +6,7 @@ use Attribute; +/** @experimental */ #[Attribute(Attribute::TARGET_METHOD)] final class PostHydrate { diff --git a/src/Extension/Lifecycle/Attribute/PreExtract.php b/src/Extension/Lifecycle/Attribute/PreExtract.php index 6d223f54..b42ac169 100644 --- a/src/Extension/Lifecycle/Attribute/PreExtract.php +++ b/src/Extension/Lifecycle/Attribute/PreExtract.php @@ -6,6 +6,7 @@ use Attribute; +/** @experimental */ #[Attribute(Attribute::TARGET_METHOD)] final class PreExtract { diff --git a/src/Extension/Lifecycle/Attribute/PreHydrate.php b/src/Extension/Lifecycle/Attribute/PreHydrate.php index bd4f0bb7..5ecb92bb 100644 --- a/src/Extension/Lifecycle/Attribute/PreHydrate.php +++ b/src/Extension/Lifecycle/Attribute/PreHydrate.php @@ -6,6 +6,7 @@ use Attribute; +/** @experimental */ #[Attribute(Attribute::TARGET_METHOD)] final class PreHydrate { diff --git a/src/Extension/Lifecycle/Lifecycle.php b/src/Extension/Lifecycle/Lifecycle.php index 0cd9522b..e5f15e1e 100644 --- a/src/Extension/Lifecycle/Lifecycle.php +++ b/src/Extension/Lifecycle/Lifecycle.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Extension\Lifecycle; +/** @experimental */ final readonly class Lifecycle { public function __construct( diff --git a/src/Extension/Lifecycle/LifecycleExtension.php b/src/Extension/Lifecycle/LifecycleExtension.php index 1bfa0d5c..47bc6113 100644 --- a/src/Extension/Lifecycle/LifecycleExtension.php +++ b/src/Extension/Lifecycle/LifecycleExtension.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\Extension; use Patchlevel\Hydrator\StackHydratorBuilder; +/** @experimental */ final readonly class LifecycleExtension implements Extension { public function configure(StackHydratorBuilder $builder): void diff --git a/src/Extension/Lifecycle/LifecycleMetadataEnricher.php b/src/Extension/Lifecycle/LifecycleMetadataEnricher.php index 332e8257..4222ac6b 100644 --- a/src/Extension/Lifecycle/LifecycleMetadataEnricher.php +++ b/src/Extension/Lifecycle/LifecycleMetadataEnricher.php @@ -14,6 +14,7 @@ use function sprintf; +/** @experimental */ final class LifecycleMetadataEnricher implements MetadataEnricher { public function enrich(ClassMetadata $classMetadata): void diff --git a/src/Extension/Lifecycle/LifecycleMiddleware.php b/src/Extension/Lifecycle/LifecycleMiddleware.php index 05e51cac..ed9db0da 100644 --- a/src/Extension/Lifecycle/LifecycleMiddleware.php +++ b/src/Extension/Lifecycle/LifecycleMiddleware.php @@ -10,6 +10,7 @@ use function assert; +/** @experimental */ final class LifecycleMiddleware implements Middleware { /** diff --git a/src/Middleware/Middleware.php b/src/Middleware/Middleware.php index 106dab61..aa6074a5 100644 --- a/src/Middleware/Middleware.php +++ b/src/Middleware/Middleware.php @@ -6,6 +6,7 @@ use Patchlevel\Hydrator\Metadata\ClassMetadata; +/** @experimental */ interface Middleware { /** diff --git a/src/Middleware/NoMoreMiddleware.php b/src/Middleware/NoMoreMiddleware.php index 8203ab3c..4d063998 100644 --- a/src/Middleware/NoMoreMiddleware.php +++ b/src/Middleware/NoMoreMiddleware.php @@ -7,6 +7,7 @@ use Patchlevel\Hydrator\HydratorException; use RuntimeException; +/** @experimental */ final class NoMoreMiddleware extends RuntimeException implements HydratorException { public function __construct() diff --git a/src/Middleware/Stack.php b/src/Middleware/Stack.php index 7a47f627..6be11ea3 100644 --- a/src/Middleware/Stack.php +++ b/src/Middleware/Stack.php @@ -4,6 +4,7 @@ namespace Patchlevel\Hydrator\Middleware; +/** @experimental */ final class Stack { private int $index = 0; diff --git a/src/Middleware/TransformMiddleware.php b/src/Middleware/TransformMiddleware.php index c180d17c..c90d1fcf 100644 --- a/src/Middleware/TransformMiddleware.php +++ b/src/Middleware/TransformMiddleware.php @@ -17,6 +17,7 @@ use function array_values; use function spl_object_id; +/** @experimental */ final class TransformMiddleware implements Middleware { /** @var array */ diff --git a/src/StackHydrator.php b/src/StackHydrator.php index bfe593bb..f0bab583 100644 --- a/src/StackHydrator.php +++ b/src/StackHydrator.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; +/** @experimental */ final class StackHydrator implements HydratorWithContext { /** @var array */ diff --git a/src/StackHydratorBuilder.php b/src/StackHydratorBuilder.php index 39c5b9b6..4d5e72f7 100644 --- a/src/StackHydratorBuilder.php +++ b/src/StackHydratorBuilder.php @@ -18,6 +18,7 @@ use function array_merge; use function krsort; +/** @experimental */ final class StackHydratorBuilder { private bool $defaultLazy = false;