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

EqualableWithPhpOperators::equals()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
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