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

TextInput::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
?>