Passed
Push — master ( 2ee0d1...1e8995 )
by Tomasz
03:21
created

AbstractStringValueObject::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Aggrego\Domain\Shared\ValueObject;
6
7
abstract class AbstractStringValueObject
8
{
9
    /** @var string */
10
    private $value;
11
12
    /** @var string */
13
    private $type;
14
15
    public function __construct(string $value, string $type)
16
    {
17
        $this->value = $value;
18
        $this->type = $type;
19
    }
20
21
    public function getValue(): string
22
    {
23
        return $this->value;
24
    }
25
26
    public function equal(self $object): bool
27
    {
28
        return $this->value === $object->value
29
            && $this->type === $object->type;
30
    }
31
}
32