/**
  * {@inheritdoc}
  */
 public function normalize($object, ContextInterface $context)
 {
     if (!$object instanceof \Traversable) {
         throw UnsupportedClassException::create($object);
     }
     $normalized = [];
     foreach ($object as $key => $child) {
         $normalized[$key] = $this->normalizerManager->normalize($child);
     }
     return $normalized;
 }
 /**
  * {@inheritDoc}
  */
 public function getNormalizerForClass($class)
 {
     if (is_object($class)) {
         $class = get_class($class);
     }
     $this->sortNormalizers();
     foreach ($this->normalizers as $entry) {
         /** @var ModelNormalizerInterface $normalizer */
         $normalizer = $entry['normalizer'];
         if ($normalizer->supportsClass($class)) {
             return $normalizer;
         }
     }
     throw UnsupportedClassException::create($class);
 }