2020use ReflectionProperty ;
2121use RuntimeException ;
2222
23- /**
24- * @template T
25- */
2623class SerializeContext
2724{
2825 private array $ groups = [];
2926 private array $ responses = [];
3027
3128 public function __construct (
32- /** @var class-string<T> */
29+ /** @var class-string */
3330 private readonly string $ serializeClassName ,
3431 private readonly ChooseSerializeContext $ chooseSerializeContext ,
3532 private readonly CacheInterface $ cache ,
@@ -208,6 +205,7 @@ className: $type->className,
208205
209206 /**
210207 * @param mixed ...$payload
208+ * @return object
211209 */
212210 public function from (mixed ...$ payload ): object
213211 {
@@ -220,7 +218,7 @@ public function from(mixed ...$payload): object
220218
221219 $ this ->chooseSerializeContext ->setGroups ($ this ->getGroups ());
222220
223- /** @var T $object */
221+
224222 $ object = $ this ->propertyInputValueResolver ->resolve ($ this ->chooseSerializeContext , $ this ->getGroupCollection (), $ payloads );
225223
226224 if ($ object instanceof Serialize && $ object ->getContext () === null ) {
@@ -231,7 +229,7 @@ public function from(mixed ...$payload): object
231229
232230 }
233231
234- public function faker ()
232+ public function faker (): object
235233 {
236234 $ this ->chooseSerializeContext ->setGroups ($ this ->getGroups ());
237235 return $ this ->fakerResolver ->resolve ($ this ->chooseSerializeContext , $ this ->getGroupCollection ());
0 commit comments