Passed
Pull Request — master (#349)
by
unknown
01:42
created

PostScriptGlyphs::getCodePoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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 1
    public static function getGlyphs()
12
    {
13 1
        if (null === self::$glyphs) {
14 1
            self::$glyphs = json_decode(file_get_contents(__DIR__.'/PostScriptGlyphs.json'), true);
15
        }
16
17 1
        return self::$glyphs;
18
    }
19
20 1
    public static function getCodePoint($glyph)
21
    {
22 1
        return hexdec(static::getGlyphs()[$glyph]);
23
    }
24
}
25