/**
  * {@inheritdoc}
  */
 public function transform($object, $targetClass)
 {
     if (count($object) == 0) {
         return [];
     }
     if (!$this->supports($object, $targetClass)) {
         throw new UnsupportedTransformationException();
     }
     $elements = [];
     foreach ($object as $element) {
         $elements[] = $this->modelTransformer->transform($element, $targetClass);
     }
     return $elements;
 }
 function it_should_not_support_transformation_if_at_least_one_object_can_not_be_transformed(ModelTransformer $modelTransformer)
 {
     $modelTransformer->supports(new \DateTime(), \stdClass::class)->willReturn(true);
     $modelTransformer->supports(new \stdClass(), \stdClass::class)->willReturn(false);
     $this->supports([new \DateTime(), new \stdClass()], \stdClass::class)->shouldBe(false);
 }