SplIntEnum::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
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