lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
public function getReaderFor($charset)
    {
        $charset = strtolower(trim($charset));
        foreach (self::$map as $pattern => $spec) {
            $re = '/^'.$pattern.'$/D';
            if (preg_match($re, $charset)) {
                if (!array_key_exists($pattern, self::$loaded)) {
                    $reflector = new ReflectionClass($spec['class']);
                    if ($reflector->getConstructor()) {
                        $reader = $reflector->newInstanceArgs($spec['constructor']);
                    } else {
                        $reader = $reflector->newInstance();
                    }
                    self::$loaded[$pattern] = $reader;
                }

                return self::$loaded[$pattern];
            }
        }
    }
public function getReaderFor($charset)
    {
        $charset = strtolower(trim($charset));
        foreach (self::$map as $pattern => $spec) {
            $re = '/^'.$pattern.'$/D';
            if (preg_match($re, $charset)) {
                if (!array_key_exists($pattern, self::$loaded)) {
                    $reflector = new ReflectionClass($spec['class']);
                    if ($reflector->getConstructor()) {
                        $reader = $reflector->newInstanceArgs($spec['constructor']);
                    } else {
                        $reader = $reflector->newInstance();
                    }
                    self::$loaded[$pattern] = $reader;
                }

                return self::$loaded[$pattern];
            }
        }
    }
public function getReaderFor ( $ charset ) { $ charset = strtolower ( trim ( $ charset ) ) ; foreach ( self :: $ map as $ pattern => $ spec ) { $ re = '/^' . $ pattern . '$/D' ; if ( preg_match ( $ re , $ charset ) ) { if ( ! array_key_exists ( $ pattern , self :: $ loaded ) ) { $ reflector = new ReflectionClass ( $ spec [ 'class' ] ) ; if ( $ reflector -> getConstructor ( ) ) { $ reader = $ reflector -> newInstanceArgs ( $ spec [ 'constructor' ] ) ; } else { $ reader = $ reflector -> newInstance ( ) ; } self :: $ loaded [ $ pattern ] = $ reader ; } return self :: $ loaded [ $ pattern ] ; } } }
Returns a CharacterReader suitable for the charset applied.

@param string $charset

@return Swift_CharacterReader
Returns a CharacterReader suitable for the charset applied .