src/Encoder/StringEncoder.php
private function getClassName($value, array $options)
    {
        foreach ($this->iterateNamespaces($value) as $partial) {
            if (isset($options['string.imports'][$partial])) {
                $trimmed = substr($value, \strlen(rtrim($partial, '\\')));
                return ltrim(sprintf('%s%s::class', rtrim($options['string.imports'][$partial], '\\'), $trimmed), '\\');
            }
        }

        return sprintf('\\%s::class', $value);
    }
private function getClassName($value, array $options)
    {
        foreach ($this->iterateNamespaces($value) as $partial) {
            if (isset($options['string.imports'][$partial])) {
                $trimmed = substr($value, \strlen(rtrim($partial, '\\')));
                return ltrim(sprintf('%s%s::class', rtrim($options['string.imports'][$partial], '\\'), $trimmed), '\\');
            }
        }

        return sprintf('\\%s::class', $value);
    }
private function getClassName ( $ value , array $ options ) { foreach ( $ this -> iterateNamespaces ( $ value ) as $ partial ) { if ( isset ( $ options [ 'string.imports' ] [ $ partial ] ) ) { $ trimmed = substr ( $ value , \ strlen ( rtrim ( $ partial , '\\' ) ) ) ; return ltrim ( sprintf ( '%s%s::class' , rtrim ( $ options [ 'string.imports' ] [ $ partial ] , '\\' ) , $ trimmed ) , '\\' ) ; } } return sprintf ( '\\%s::class' , $ value ) ; }
Encodes the given string as a class name constant based on used imports.
@param string $value The string to encode
@param array $options The string encoding options
@return string The class constant PHP code representation
Encodes the given string as a class name constant based on used imports .