IsolateComparer::areEqual()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 4
nc 4
nop 2
1
<?php
2
3
namespace Isolate\Framework\UnitOfWork\Entity;
4
5
use Isolate\LazyObjects\WrappedObject;
6
use Isolate\UnitOfWork\Entity\Comparer;
7
8
class IsolateComparer extends Comparer
9
{
10
    /**
11
     * @param $firstEntity
12
     * @param $secondEntity
13
     * @return bool
14
     * @throws \Isolate\UnitOfWork\Exception\InvalidArgumentException
15
     */
16
    public function areEqual($firstEntity, $secondEntity)
17
    {
18
        $firstTarget = ($firstEntity instanceof WrappedObject) ? $firstEntity->getWrappedObject() : $firstEntity;
19
        $secondTarget = ($secondEntity instanceof WrappedObject) ? $secondEntity->getWrappedObject() : $secondEntity;
20
21
        return parent::areEqual($firstTarget, $secondTarget);
22
    }
23
}
24