Failed Conditions
Pull Request — develop (#6719)
by Marco
65:21
created

ComparableObject::equalTo()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\Models\FriendObject;
6
7
use Doctrine\ORM\Annotation as ORM;
8
9
/** @ORM\Entity */
10
class ComparableObject
11
{
12
    /** @ORM\Id @ORM\Column(type="integer") */
13
    public $id;
14
15
    /** @ORM\Column(type="string") */
16
    private $comparedField;
17
18
    public function equalTo(self $other) : bool
19
    {
20
        return $other === $this
21
            || $other->comparedField === $this->comparedField;
22
    }
23
24
    public function setComparedFieldValue(string $value) : void
25
    {
26
        $this->comparedField = $value;
27
    }
28
}
29