SplIntEnum   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 22
ccs 0
cts 5
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __invoke() 0 3 1
1
<?php
2
3
/**
4
 * Part of SplTypes package.
5
 *
6
 * (c) Adrien Loyant <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Ducks\Component\SplTypes;
15
16
/**
17
 * SplIntEnum gives the ability to emulate and create int enumeration objects natively in PHP.
18
 *
19
 * @extends SplEnumBacked<int>
20
 *
21
 * @psalm-api
22
 */
23
abstract class SplIntEnum extends SplEnumBacked
24
{
25
    /**
26
     * Value of enum instance.
27
     *
28
     * @var int
29
     */
30
    protected int $value;
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    final protected function __construct()
36
    {
37
        $this->__default = 0;
38
39
        parent::__construct();
40
    }
41
42
    final public function &__invoke(): int
43
    {
44
        return $this->__default;
45
    }
46
}
47