Test Failed
Push — 7.x ( bea7e1...2b11c5 )
by Adrien
08:51
created

SplStringEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 22
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
 * SplStringEnum gives the ability to emulate and create int enumeration objects natively in PHP.
18
 *
19
 * @psalm-api
20
 */
21
abstract class SplStringEnum extends SplEnumBacked
22
{
23
    /**
24
     * Value of enum instance
25
     *
26
     * @var string
27
     */
28
    protected string $value;
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    final protected function __construct()
34
    {
35
        $this->__default = '';
36
37
        parent::__construct();
38
    }
39
40
    final public function &__invoke(): string
41
    {
42
        return $this->__default;
43
    }
44
}
45