SmartObjectRegister::register()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 2
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
/**
4
 * Register for Smart Objects.
5
 */
6
declare(strict_types = 1);
7
8
namespace HDNET\Autoloader;
9
10
/**
11
 * Register for Smart Objects.
12
 */
13
class SmartObjectRegister
14
{
15
    /**
16
     * Register for smart object information.
17
     *
18
     * @var array
19
     */
20
    protected static $smartObjectRegistry = [];
21
22
    /**
23
     * Add a model to the register.
24
     *
25
     * @param $modelName
26
     */
27
    public static function register($modelName): void
28
    {
29
        if (!\in_array($modelName, self::$smartObjectRegistry, true)) {
30
            self::$smartObjectRegistry[] = $modelName;
31
        }
32
    }
33
34
    /**
35
     * Get the register content.
36
     *
37
     * @return array
38
     */
39
    public static function getRegister()
40
    {
41
        return self::$smartObjectRegistry;
42
    }
43
}
44