Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 11... Zeile 11...
11
 * file that was distributed with this source code.
11
 * file that was distributed with this source code.
12
 */
12
 */
Zeile 13... Zeile 13...
13
 
13
 
Zeile -... Zeile 14...
-
 
14
namespace League\CommonMark\Util;
-
 
15
 
14
namespace League\CommonMark\Util;
16
use League\CommonMark\Exception\IOException;
15
 
17
 
16
/**
18
/**
17
 * Reads in a CommonMark spec document and extracts the input/output examples for testing against them
19
 * Reads in a CommonMark spec document and extracts the input/output examples for testing against them
18
 */
20
 */
Zeile 54... Zeile 56...
54
    }
56
    }
Zeile 55... Zeile 57...
55
 
57
 
56
    /**
58
    /**
57
     * @return iterable<string, array{input: string, output: string, type: string, section: string, number: int}>
59
     * @return iterable<string, array{input: string, output: string, type: string, section: string, number: int}>
58
     *
60
     *
59
     * @throws \RuntimeException if the file cannot be loaded
61
     * @throws IOException if the file cannot be loaded
60
     */
62
     */
61
    public static function readFile(string $filename): iterable
63
    public static function readFile(string $filename): iterable
62
    {
64
    {
63
        if (($data = \file_get_contents($filename)) === false) {
65
        if (($data = \file_get_contents($filename)) === false) {
64
            throw new \RuntimeException(\sprintf('Failed to load spec from %s', $filename));
66
            throw new IOException(\sprintf('Failed to load spec from %s', $filename));
Zeile 65... Zeile 67...
65
        }
67
        }
66
 
68
 
67
        return self::read($data);
69
        return self::read($data);