src/Options.php
public static function factory($file)
    {
        if (! file_Exists($file)) {
            $file = $file . '.dist';
            if (! file_exists($file)) {
                throw new \Org\Heigl\Hyphenator\Exception\PathNotFoundException($file);
            }
        }
        $params = parse_ini_file($file);
        if (! is_array($params) || 1 > count($params)) {
            throw new \Org\Heigl\Hyphenator\Exception\InvalidArgumentException($file . ' is not a parseable file');
        }

        $option = new Options();
        foreach ($params as $key => $val) {
            if (! method_Exists($option, 'set' . $key)) {
                continue;
            }
            call_user_Func(array($option,'set' . $key), $val);
        }

        return $option;
    }
public static function factory($file)
    {
        if (! file_Exists($file)) {
            $file = $file . '.dist';
            if (! file_exists($file)) {
                throw new \Org\Heigl\Hyphenator\Exception\PathNotFoundException($file);
            }
        }
        $params = parse_ini_file($file);
        if (! is_array($params) || 1 > count($params)) {
            throw new \Org\Heigl\Hyphenator\Exception\InvalidArgumentException($file . ' is not a parseable file');
        }

        $option = new Options();
        foreach ($params as $key => $val) {
            if (! method_Exists($option, 'set' . $key)) {
                continue;
            }
            call_user_Func(array($option,'set' . $key), $val);
        }

        return $option;
    }
Create an Option-Object by parsing a given file.

@param string $file The config-file to be parsed

@throws \Org\Heigl\Hyphenator\Exception\PathNotFoundException
@throws \Org\Heigl\Hyphenator\Exception\InvalidArgumentException
@return \Org\Heigl\Hyphenator\Options