| 
27 | 27 | use JMS\Serializer\Metadata\ClassMetadata;  | 
28 | 28 | use JMS\Serializer\NullAwareVisitorInterface;  | 
29 | 29 | use JMS\Serializer\SerializationContext;  | 
 | 30 | +use JMS\Serializer\Type\Type;  | 
30 | 31 | use JMS\Serializer\Visitor\SerializationVisitorInterface;  | 
31 | 32 | use JMS\Serializer\VisitorInterface;  | 
32 | 33 | use Metadata\MetadataFactoryInterface;  | 
 | 
40 | 41 |  * on visitors, or custom handlers to process its nodes.  | 
41 | 42 |  *  | 
42 | 43 |  * @author Johannes M. Schmitt <[email protected]>  | 
 | 44 | + *  | 
 | 45 | + * @phpstan-import-type TypeArray from Type  | 
43 | 46 |  */  | 
44 | 47 | final class SerializationGraphNavigator extends GraphNavigator  | 
45 | 48 | {  | 
@@ -112,7 +115,7 @@ public function initialize(VisitorInterface $visitor, Context $context): void  | 
112 | 115 |      * Called for each node of the graph that is being traversed.  | 
113 | 116 |      *  | 
114 | 117 |      * @param mixed $data the data depends on the direction, and type of visitor  | 
115 |  | -     * @param array|null $type array has the format ["name" => string, "params" => array]  | 
 | 118 | +     * @param TypeArray|null $type array has the format ["name" => string, "params" => array]  | 
116 | 119 |      *  | 
117 | 120 |      * @return mixed the return value depends on the direction, and type of visitor  | 
118 | 121 |      */  | 
@@ -296,6 +299,9 @@ private function isRootNullAllowed(): bool  | 
296 | 299 |         return $this->context->hasAttribute('allows_root_null') && $this->context->getAttribute('allows_root_null') && 0 === $this->context->getVisitingSet()->count();  | 
297 | 300 |     }  | 
298 | 301 | 
 
  | 
 | 302 | +    /**  | 
 | 303 | +     * @param TypeArray $type  | 
 | 304 | +     */  | 
299 | 305 |     private function afterVisitingObject(ClassMetadata $metadata, object $object, array $type): void  | 
300 | 306 |     {  | 
301 | 307 |         $this->context->stopVisiting($object);  | 
 | 
0 commit comments