Passed
Push — master ( 913c0a...fd8403 )
by Ondřej
05:45
created

EqualableWithPhpOperators   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A equals() 0 8 3
1
<?php
2
declare(strict_types=1);
3
namespace Ivory\Value\Alg;
4
5
/**
6
 * Provides an implementation of the {@link IEqualable} interface, comparing objects using the PHP `==` operator.
7
 */
8
trait EqualableWithPhpOperators
9
{
10
    final public function equals($other): bool
11
    {
12
        return (
13
            $other !== null &&
14
            get_class($this) == get_class($other) &&
15
            $this == $other
16
        );
17
    }
18
}
19