@@ -30,8 +30,8 @@ class ValueObjectTransformer implements DataTransformerInterface
3030{
3131 use ExceptionToErrorMapperTrait;
3232
33- private $ propertyAccessor ;
34- private $ form ;
33+ private PropertyAccessorInterface $ propertyAccessor ;
34+ private FormBuilderInterface $ form ;
3535
3636 public function __construct (ExceptionHandlerRegistry $ exceptionHandlerRegistry , PropertyAccessorInterface $ propertyAccessor , FormBuilderInterface $ form )
3737 {
@@ -43,7 +43,7 @@ public function __construct(ExceptionHandlerRegistry $exceptionHandlerRegistry,
4343 /**
4444 * @param mixed $value
4545 *
46- * @return string| array<string,string> |null
46+ * @return array<string,bool|int| string|null>|bool|int|string |null
4747 */
4848 public function transform ($ value )
4949 {
@@ -73,10 +73,7 @@ public function transform($value)
7373 return $ this ->getPropertyValue ($ this ->form , $ value );
7474 }
7575
76- /**
77- * @return object
78- */
79- public function reverseTransform ($ value )
76+ public function reverseTransform ($ value ): object
8077 {
8178 try {
8279 return (new ViewDataInstantiator ($ this ->form , $ value ))->instantiateObject ();
@@ -92,11 +89,9 @@ public function reverseTransform($value)
9289 }
9390
9491 /**
95- * @param object $object
96- *
97- * @return string
92+ * @return bool|int|string|null
9893 */
99- private function getPropertyValue (FormBuilderInterface $ form , $ object )
94+ private function getPropertyValue (FormBuilderInterface $ form , object $ object )
10095 {
10196 if (null !== $ form ->getPropertyPath ()) {
10297 return $ this ->propertyAccessor ->getValue ($ object , $ form ->getPropertyPath ());
0 commit comments