Passed
Push — master ( 8dcdb6...5c2e0a )
by Jakub
01:56
created

TextInput   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 57
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 2 1
A getTitle() 0 2 1
A getLink() 0 2 1
A setLink() 0 2 1
A __construct() 0 5 1
A setName() 0 2 1
A setTitle() 0 2 1
A setDescription() 0 2 1
A appendToXml() 0 6 1
A getDescription() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Rss;
5
6
/**
7
 * TextInput
8
 *
9
 * @author Jakub Konečný
10
 * @property string $title
11
 * @property string $description
12
 * @property string $name
13
 * @property string $link
14
 */
15 1
final class TextInput implements IXmlConvertible {
16 1
  use \Nette\SmartObject;
17
18
  /** @var string */
19
  protected $title;
20
  /** @var string */
21
  protected $description;
22
  /** @var string */
23
  protected $name;
24
  /** @var string */
25
  protected $link;
26
27
  public function __construct(string $title, string $description, string $name, string $link) {
28 1
    $this->title = $title;
29 1
    $this->description = $description;
30 1
    $this->name = $name;
31 1
    $this->link = $link;
32 1
  }
33
34
  public function getTitle(): string {
35 1
    return $this->title;
36
  }
37
38
  public function setTitle(string $title): void {
39 1
    $this->title = $title;
40 1
  }
41
42
  public function getDescription(): string {
43 1
    return $this->description;
44
  }
45
46
  public function setDescription(string $description): void {
47 1
    $this->description = $description;
48 1
  }
49
50
  public function getName(): string {
51 1
    return $this->name;
52
  }
53
54
  public function setName(string $name): void {
55 1
    $this->name = $name;
56 1
  }
57
58
  public function getLink(): string {
59 1
    return $this->link;
60
  }
61
62
  public function setLink(string $link): void {
63 1
    $this->link = $link;
64 1
  }
65
66
  public function appendToXml(\SimpleXMLElement &$parent): void {
67 1
    $element = $parent->addChild("textInput");
68 1
    $element->addChild("title", $this->title);
69 1
    $element->addChild("description", $this->description);
70 1
    $element->addChild("name", $this->name);
71 1
    $element->addChild("link", $this->link);
72 1
  }
73
}
74
?>