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

PostScriptGlyphs   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 10
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCodePoint() 0 3 1
A getGlyphs() 0 7 2
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