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

JobDescription   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A equals() 0 4 2
A create() 0 3 1
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
}