Completed
Pull Request — master (#296)
by
unknown
03:33
created

Author::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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
     * @return string
35
     */
36 9
    public function getName() : ? string
37
    {
38 9
        return $this->name;
39
    }
40
41
    /**
42
     * @param  string $name
43
     * @return AuthorInterface
44
     */
45 18
    public function setName(string $name = null) : AuthorInterface
46
    {
47 18
        $this->name = $name;
48
49 18
        return $this;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 5
    public function getUri() : ? string
56
    {
57 5
        return $this->uri;
58
    }
59
60
    /**
61
     * @param  string $uri
62
     * @return AuthorInterface
63
     */
64 9
    public function setUri(string $uri = null) : AuthorInterface
65
    {
66 9
        $this->uri = $uri;
67
68 9
        return $this;
69
    }
70
71
    /**
72
     * @return string
73
     */
74 4
    public function getEmail() : ? string
75
    {
76 4
        return $this->email;
77
    }
78
79
    /**
80
     * @param  string $email
81
     * @return AuthorInterface
82
     */
83 9
    public function setEmail(string $email = null) : AuthorInterface
84
    {
85 9
        $this->email = $email;
86
87 9
        return $this;
88
    }
89
90
    /**
91
     * @return array
92
     */
93 2
    public function toArray() : array
94
    {
95 2
        return get_object_vars($this);
96
    }
97
}
98