DetailLawyer   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 68
ccs 21
cts 21
cp 1
rs 10
c 0
b 0
f 0
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A loadFromLawyer() 0 9 1
A setChamberOfLaw() 0 5 1
A setLawFormation() 0 5 1
A getLawFormation() 0 3 1
A getChamberOfLaw() 0 3 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SomeWork\Minjust\Entity;
6
7
/**
8
 * @see \SomeWork\Minjust\Tests\Unit\Entity\DetailLawyerTest
9
 */
10
class DetailLawyer extends Lawyer
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $chamberOfLaw = '';
16
17
    /**
18
     * @var LawFormation|null
19
     */
20
    protected $lawFormation;
21
22 3
    public function __construct(?Lawyer $lawyer = null)
23
    {
24 3
        if ($lawyer !== null) {
25 1
            $this->loadFromLawyer($lawyer);
26
        }
27 3
    }
28
29 1
    public function loadFromLawyer(Lawyer $lawyer): self
30
    {
31
        return $this
32 1
            ->setRegisterNumber($lawyer->getRegisterNumber())
33 1
            ->setFullName($lawyer->getFullName())
34 1
            ->setUrl($lawyer->getUrl())
35 1
            ->setLocation($lawyer->getLocation())
36 1
            ->setCertificateNumber($lawyer->getCertificateNumber())
37 1
            ->setStatus($lawyer->getStatus());
38
    }
39
40
    /**
41
     * @return string
42
     */
43 1
    public function getChamberOfLaw(): string
44
    {
45 1
        return $this->chamberOfLaw ?: '';
46
    }
47
48
    /**
49
     * @param string $chamberOfLaw
50
     *
51
     * @return DetailLawyer
52
     */
53 1
    public function setChamberOfLaw(string $chamberOfLaw): DetailLawyer
54
    {
55 1
        $this->chamberOfLaw = $chamberOfLaw;
56
57 1
        return $this;
58
    }
59
60
    /**
61
     * @return LawFormation|null
62
     */
63 1
    public function getLawFormation(): ?LawFormation
64
    {
65 1
        return $this->lawFormation;
66
    }
67
68
    /**
69
     * @param LawFormation|null $lawFormation
70
     *
71
     * @return DetailLawyer
72
     */
73 1
    public function setLawFormation(?LawFormation $lawFormation): DetailLawyer
74
    {
75 1
        $this->lawFormation = $lawFormation;
76
77 1
        return $this;
78
    }
79
}
80