DependencyInjection/Compiler/ConverterPass.php
protected function getType(ContainerBuilder $container, $serviceId)
    {
        $def = $container->getDefinition($serviceId);
        $class = $this->getRealValue($container, $def->getClass());
        $interfaces = class_implements($class);
        $error = sprintf('The service id "%s" must be an class implementing the "%s" interface.', $serviceId, ConverterInterface::class);

        if (\in_array(ConverterInterface::class, $interfaces, true)) {
            $ref = new \ReflectionClass($class);
            /** @var ConverterInterface $instance */
            $instance = $ref->newInstanceWithoutConstructor();
            $type = $instance->getName();

            if ($type) {
                return $type;
            }

            $error = sprintf('The service id "%s" must have the "type" parameter in the "fxp_resource.converter" tag.', $serviceId);
        }

        throw new InvalidConfigurationException($error);
    }
protected function getType(ContainerBuilder $container, $serviceId)
    {
        $def = $container->getDefinition($serviceId);
        $class = $this->getRealValue($container, $def->getClass());
        $interfaces = class_implements($class);
        $error = sprintf('The service id "%s" must be an class implementing the "%s" interface.', $serviceId, ConverterInterface::class);

        if (\in_array(ConverterInterface::class, $interfaces, true)) {
            $ref = new \ReflectionClass($class);
            /** @var ConverterInterface $instance */
            $instance = $ref->newInstanceWithoutConstructor();
            $type = $instance->getName();

            if ($type) {
                return $type;
            }

            $error = sprintf('The service id "%s" must have the "type" parameter in the "fxp_resource.converter" tag.', $serviceId);
        }

        throw new InvalidConfigurationException($error);
    }
protected function getType ( ContainerBuilder $ container , $ serviceId ) { $ def = $ container -> getDefinition ( $ serviceId ) ; $ class = $ this -> getRealValue ( $ container , $ def -> getClass ( ) ) ; $ interfaces = class_implements ( $ class ) ; $ error = sprintf ( 'The service id "%s" must be an class implementing the "%s" interface.' , $ serviceId , ConverterInterface :: class ) ; if ( \ in_array ( ConverterInterface :: class , $ interfaces , true ) ) { $ ref = new \ ReflectionClass ( $ class ) ; /** @var ConverterInterface $instance */ $ instance = $ ref -> newInstanceWithoutConstructor ( ) ; $ type = $ instance -> getName ( ) ; if ( $ type ) { return $ type ; } $ error = sprintf ( 'The service id "%s" must have the "type" parameter in the "fxp_resource.converter" tag.' , $ serviceId ) ; } throw new InvalidConfigurationException ( $ error ) ; }
Get the converter type name.

@param ContainerBuilder $container The container builder
@param string           $serviceId The service id of converter

@throws InvalidConfigurationException When the converter name is not got

@return string
Get the converter type name .