Book::isbn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Clearcode\EHLibrary\Model;
4
5
use Ramsey\Uuid\UuidInterface;
6
7
final class Book implements Aggregate
8
{
9
    /** @var UuidInterface */
10
    private $bookId;
11
    /** @var string */
12
    private $title;
13
    /** @var string */
14
    private $authors;
15
    /** @var string */
16
    private $isbn;
17
18
    /**
19
     * @param UuidInterface $bookId
20
     * @param string        $title
21
     * @param string        $authors
22
     * @param string        $isbn
23
     */
24
    public function __construct(UuidInterface $bookId, $title, $authors, $isbn)
25
    {
26
        $this->bookId  = $bookId;
27
        $this->title   = $title;
28
        $this->authors = $authors;
29
        $this->isbn    = $isbn;
30
    }
31
32
    /**
33
     * @return UuidInterface
34
     */
35
    public function id()
36
    {
37
        return $this->bookId;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function title()
44
    {
45
        return $this->title;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function authors()
52
    {
53
        return $this->authors;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function isbn()
60
    {
61
        return $this->isbn;
62
    }
63
}
64