Completed
Push — master ( 817258...6733f8 )
by Alex
29s queued 11s
created

Author::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Feed\Item;
12
13
use FeedIo\Feed\ArrayableInterface;
14
15
class Author implements AuthorInterface, ArrayableInterface
16
{
17
18
    /**
19
     * @var string
20
     */
21
    protected $name;
22
23
    /**
24
     * @var string
25
     */
26
    protected $uri;
27
28
    /**
29
     * @var string
30
     */
31
    protected $email;
32
33
    /**
34 10
     * @return string
35
     */
36 10
    public function getName() : ? string
37
    {
38
        return $this->name;
39
    }
40
41
    /**
42
     * @param  string $name
43 17
     * @return AuthorInterface
44
     */
45 17
    public function setName(string $name = null) : AuthorInterface
46
    {
47 17
        $this->name = $name;
48
49
        return $this;
50
    }
51
52
    /**
53 6
     * @return string
54
     */
55 6
    public function getUri() : ? string
56
    {
57
        return $this->uri;
58
    }
59
60
    /**
61
     * @param  string $uri
62 8
     * @return AuthorInterface
63
     */
64 8
    public function setUri(string $uri = null) : AuthorInterface
65
    {
66 8
        $this->uri = $uri;
67
68
        return $this;
69
    }
70
71
    /**
72 5
     * @return string
73
     */
74 5
    public function getEmail() : ? string
75
    {
76
        return $this->email;
77
    }
78
79
    /**
80
     * @param  string $email
81 8
     * @return AuthorInterface
82
     */
83 8
    public function setEmail(string $email = null) : AuthorInterface
84
    {
85 8
        $this->email = $email;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return array
92
     */
93
    public function toArray() : array
94
    {
95
        return get_object_vars($this);
96
    }
97
}
98