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

PropertiesUtil   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getProperties() 0 10 2
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