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

ComparableObject   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A equalTo() 0 5 2
A setComparedFieldValue() 0 4 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