Passed
Push — master ( fd358c...339072 )
by Ondřej
03:23
created

EqualableWithPhpOperators   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

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