public static function createFromFile(\SplFileInfo $file_info)
    {
        $contents = file_get_contents($file_info);

        if (!$contents) {
            throw new \RuntimeException(
                sprintf(
                    'Unable to retrieve contents from file (%s).',
                    $file_info->getRealPath()
                )
            );
        }

        return self::createFromString($contents);
    }