Passed
Push — master ( 257b57...81bbde )
by Adel
03:02
created

JobDescription::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Domain\ValueObjects;
4
5
use Doctrine\ORM\Mapping AS ORM;
6
7
/** @ORM\Embeddable */
8
final class JobDescription
9
{
10
    /**
11
     * @var string
12
     * @ORM\Column(type="string")
13
     */
14
    private $title;
15
16
    /**
17
     * @var string
18
     * @ORM\Column(type="string")
19
     */
20
    private $description;
21
22
    private function __construct(string $title, string $description)
23
    {
24
        $this->title = $title;
25
        $this->description = $description;
26
    }
27
28
    public static function create(string $title, string $description): JobDescription
29
    {
30
        return new JobDescription($title, $description);
31
    }
32
33
    public function equals(JobDescription $other): bool
34
    {
35
        return $this->title === $other->title
36
            && $this->description == $other->description;
37
    }
38
}