Test Failed
Branch main (8f4107)
by Bingo
08:27 queued 02:15
created

ProductPropertiesUtil::getProductVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Jabe\Engine\Impl\Util;
4
5
class ProductPropertiesUtil
6
{
7
    public const PROPERTIES_FILE_PATH = "src/Engine/Resources/product-info.properties";
8
    public const VERSION_PROPERTY = "jabe.version";
9
    private static $INSTANCE;
10
11
    public static function instance(): array
12
    {
13
        if (self::$INSTANCE === null) {
14
            self::$INSTANCE = PropertiesUtil::getProperties(self::PROPERTIES_FILE_PATH);
15
        }
16
        return self::$INSTANCE;
17
    }
18
19
    /**
20
     * @return the current version of the product
21
     */
22
    public static function getProductVersion(): string
23
    {
24
        return self::instance()[self::VERSION_PROPERTY];
25
    }
26
}
27