Lines Matching refs:type

106      * @param array|null $type array has the format ["name" => string, "params" => array]
110 public function accept($data, ?array $type = null) argument
114 if (null === $type) {
120 $type = ['name' => $typeName, 'params' => []];
124 $type = ['name' => 'NULL', 'params' => []];
129 $type = ['name' => 'NULL', 'params' => []];
132 switch ($type['name']) {
137 return $this->visitor->visitNull($data, $type);
140 return $this->visitor->visitString((string) $data, $type);
144 return $this->visitor->visitInteger((int) $data, $type);
148 return $this->visitor->visitBoolean((bool) $data, $type);
152 return $this->visitor->visitDouble((float) $data, $type);
155 return $this->visitor->visitArray((array) $data, $type);
175 if (class_exists($type['name'], false) || interface_exists($type['name'], false)) {
176 if (is_subclass_of($data, $type['name'], false)) {
177 $type = ['name' => \get_class($data), 'params' => []];
183 … if ($this->dispatcher->hasListeners('serializer.pre_serialize', $type['name'], $this->format)) {
184 …ch('serializer.pre_serialize', $type['name'], $this->format, $event = new PreSerializeEvent($this-…
185 $type = $event->getType();
191 …erRegistry->getHandler(GraphNavigatorInterface::DIRECTION_SERIALIZATION, $type['name'], $this->for…
192 $rs = \call_user_func($handler, $this->visitor, $data, $type, $this->context);
199 $metadata = $this->metadataFactory->getMetadataForClass($type['name']);
217 $this->visitor->startVisitingObject($metadata, $data, $type);
238 $this->afterVisitingObject($metadata, $data, $type);
240 return $this->visitor->endVisitingObject($metadata, $data, $type);
244 private function afterVisitingObject(ClassMetadata $metadata, object $object, array $type): void argument
254 ….post_serialize', $metadata->name, $this->format, new ObjectEvent($this->context, $object, $type));