src/Serializer/AbstractItemNormalizer.php
protected function getDataTransformer($object, string $to, array $context = []): ?DataTransformerInterface
    {
        foreach ($this->dataTransformers as $dataTransformer) {
            if ($dataTransformer->supportsTransformation($object, $to, $context)) {
                return $dataTransformer;
            }
        }

        return null;
    }
protected function getDataTransformer($object, string $to, array $context = []): ?DataTransformerInterface
    {
        foreach ($this->dataTransformers as $dataTransformer) {
            if ($dataTransformer->supportsTransformation($object, $to, $context)) {
                return $dataTransformer;
            }
        }

        return null;
    }
protected function getDataTransformer ( $ object , string $ to , array $ context = [ ] ) : ? DataTransformerInterface { foreach ( $ this -> dataTransformers as $ dataTransformer ) { if ( $ dataTransformer -> supportsTransformation ( $ object , $ to , $ context ) ) { return $ dataTransformer ; } } return null ; }
Finds the first supported data transformer if any.
Finds the first supported data transformer if any .