normalizer = $normalizer; $this->discriminatorType = $discriminatorType; $this->discriminatorValue = $discriminatorValue; } public function normalize(array $attributes, string $format = 'docgen', ?array $context = []) { $data = []; $data['isNull'] = true; if (null !== $this->discriminatorType) { $data[$this->discriminatorType] = $this->discriminatorValue; } foreach ($attributes as $key => $class) { if (is_numeric($key)) { $data[$class] = ''; } else { switch ($class) { case 'array': case 'bool': case 'double': case 'float': case 'int': case 'resource': case 'string': case 'null': $data[$key] = ''; break; default: $data[$key] = $this->normalizer->normalize(null, $format, array_merge( $context, ['docgen:expects' => $class] )); break; } } } return $data; } }