BaseScalar   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A equals() 0 10 2
1
<?php
2
3
namespace BaseValueObject\Scalar;
4
5
/**
6
 * Class BaseScalar
7
 * @package BaseValueObject\Scalar
8
 */
9
abstract class BaseScalar implements ValueObject
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 9
    public function equals(ValueObject $valueObject): bool
15
    {
16 9
        if (!$valueObject instanceof static) {
17 3
            throw new \InvalidArgumentException(
18 3
                "You can't compare different classes."
19
            );
20
        }
21
22 6
        return $this->value() === $valueObject->value();
23
    }
24
}
25