@@ -28,44 +28,29 @@ final class PropertyMetadata
2828
2929 /** @param (callable(string, mixed):mixed)|null $sensitiveDataFallbackCallable */
3030 public function __construct (
31- private readonly ReflectionProperty $ reflection ,
32- private readonly string $ fieldName ,
33- private readonly Normalizer |null $ normalizer = null ,
34- private readonly string |null $ subjectIdName = null ,
35- private readonly string |null $ sensitiveDataSubjectIdName = null ,
36- private readonly mixed $ sensitiveDataFallback = null ,
37- private readonly mixed $ sensitiveDataFallbackCallable = null ,
31+ public readonly ReflectionProperty $ reflection ,
32+ public readonly string $ fieldName ,
33+ public readonly Normalizer |null $ normalizer = null ,
34+ public readonly string |null $ subjectIdName = null ,
35+ public readonly string |null $ sensitiveDataSubjectIdName = null ,
36+ public readonly mixed $ sensitiveDataFallback = null ,
37+ public readonly mixed $ sensitiveDataFallbackCallable = null ,
3838 ) {
3939 if (str_starts_with ($ fieldName , self ::ENCRYPTED_PREFIX )) {
4040 throw new InvalidArgumentException ('fieldName must not start with ! ' );
4141 }
4242 }
4343
44- public function reflection (): ReflectionProperty
45- {
46- return $ this ->reflection ;
47- }
48-
4944 public function propertyName (): string
5045 {
5146 return $ this ->reflection ->getName ();
5247 }
5348
54- public function fieldName (): string
55- {
56- return $ this ->fieldName ;
57- }
58-
5949 public function encryptedFieldName (): string
6050 {
6151 return self ::ENCRYPTED_PREFIX . $ this ->fieldName ;
6252 }
6353
64- public function normalizer (): Normalizer |null
65- {
66- return $ this ->normalizer ;
67- }
68-
6954 public function setValue (object $ object , mixed $ value ): void
7055 {
7156 $ this ->reflection ->setValue ($ object , $ value );
@@ -76,28 +61,18 @@ public function getValue(object $object): mixed
7661 return $ this ->reflection ->getValue ($ object );
7762 }
7863
79- /** @phpstan-assert-if-true !null $this->sensitiveDataSubjectIdName() */
64+ /** @phpstan-assert-if-true !null $this->sensitiveDataSubjectIdName */
8065 public function isSensitiveData (): bool
8166 {
8267 return $ this ->sensitiveDataSubjectIdName !== null ;
8368 }
8469
85- /** @phpstan-assert-if-true !null $this->subjectIdName() */
70+ /** @phpstan-assert-if-true !null $this->subjectIdName */
8671 public function isSubjectId (): bool
8772 {
8873 return $ this ->subjectIdName !== null ;
8974 }
9075
91- public function subjectIdName (): string |null
92- {
93- return $ this ->subjectIdName ;
94- }
95-
96- public function sensitiveDataFallback (): mixed
97- {
98- return $ this ->sensitiveDataFallback ;
99- }
100-
10176 /** @return (Closure(string, mixed):mixed)|null */
10277 public function sensitiveDataFallbackCallable (): Closure |null
10378 {
@@ -108,11 +83,6 @@ public function sensitiveDataFallbackCallable(): Closure|null
10883 return null ;
10984 }
11085
111- public function sensitiveDataSubjectIdName (): string |null
112- {
113- return $ this ->sensitiveDataSubjectIdName ;
114- }
115-
11686 /** @return serialized */
11787 public function __serialize (): array
11888 {
0 commit comments