Test Failed
Push — main ( ea931b...8f4107 )
by Bingo
06:03
created

PropertiesUtil::getProperties()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Jabe\Engine\Impl\Util;
4
5
use Jabe\Engine\Impl\ProcessEngineLogger;
6
7
class PropertiesUtil
8
{
9
    //protected static final EngineUtilLogger LOG = ProcessEngineLogger.UTIL_LOGGER;
10
11
12
    public static function getProperties(string $propertiesFile)
13
    {
14
        $fd = fopen($propertiesFile, 'r');
15
        $properies = [];
16
        while (($line = fgets($fd)) !== false) {
17
            $pair = explode('=', $line);
18
            $properies[$pair[0]] = trim($pair[1]);
19
        }
20
        fclose($fd);
21
        return $properies;
22
    }
23
}
24