Test Failed
Push — master ( c55034...101a53 )
by JAIME ELMER
03:40
created

LogoMgr::getLogoString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MÓDULO DE EMISIÓN ELECTRÓNICA F72X
5
 * UBL 2.1
6
 * Version 1.0
7
 * 
8
 * Copyright 2019, Jaime Cruz
9
 */
10
11
namespace F72X\Tools;
12
13
use F72X\F72X;
14
use F72X\Company;
15
16
class LogoMgr {
17
18
    public static function getLogoString() {
19
        $customLogoPath = Company::getPdfTemplatesPath() . '/company-logo.png';
20
        if (file_exists($customLogoPath)) {
21
            return base64_encode(file_get_contents($customLogoPath));
22
        }
23
        $defaultLogoPath = F72X::getDefaultPdfTemplatesPath() . '/company-logo.png';
24
        return base64_encode(file_get_contents($defaultLogoPath));
25
    }
26
27
}
28