Completed
Pull Request — master (#349)
by
unknown
05:52
created

PostScriptGlyphs::getGlyphs()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
// Source : https://github.com/OpenPrinting/cups-filters/blob/master/fontembed/aglfn13.c
4
5
namespace Smalot\PdfParser\Encoding;
6
7
class PostScriptGlyphs
8
{
9
    private static $glyphs = null;
10
11
    public static function getGlyphs()
12
    {
13
        if (null === self::$glyphs) {
14
            self::$glyphs = json_decode(file_get_contents(__DIR__.'/PostScriptGlyphs.json'), true);
15
        }
16
17
        return self::$glyphs;
18
    }
19
20
    public static function getCodePoint($glyph)
21
    {
22
        return hexdec(static::getGlyphs()[$glyph]);
23
    }
24
}
25