AssetHelper::getConfig()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
ccs 5
cts 5
cp 1
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace TinyPngBundle\Helper;
4
5
/**
6
 * Class AssetHelper
7
 * @package TinyPngBundle\Helper
8
 */
9
class AssetHelper
10
{
11
    /**
12
     * @return array
13
     */
14 4
    public static function getConfig() : array
15
    {
16 4
        $configFilePath = PIMCORE_CONFIGURATION_DIRECTORY . '/tinypng.php';
17 4
        if (!file_exists($configFilePath)) {
18 2
            return ['config' => ['apiKey' => '']];
19
        }
20
21 2
        return include($configFilePath);
22
    }
23
}