AbstractValueObject::__construct()   A
last analyzed

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * value-object (https://github.com/phpgears/value-object).
5
 * Value object for PHP.
6
 *
7
 * @license MIT
8
 * @link https://github.com/phpgears/value-object
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Gears\ValueObject;
15
16
use Gears\Immutability\ImmutabilityBehaviour;
17
18
/**
19
 * Abstract immutable value object.
20
 */
21
abstract class AbstractValueObject implements ValueObject
22
{
23
    use ImmutabilityBehaviour;
24
25
    /**
26
     * AbstractValueObject constructor.
27
     */
28
    final protected function __construct()
29
    {
30
        $this->assertImmutable();
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     *
36
     * @return string[]
37
     */
38
    final protected function getAllowedInterfaces(): array
39
    {
40
        return [static::class];
41
    }
42
}
43