TextInput::__construct()   A
last analyzed

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 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
c 1
b 0
f 1
nc 1
nop 4
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Rss;
5
6
/**
7
 * TextInput
8
 *
9
 * @author Jakub Konečný
10
 */
11 1
final class TextInput implements IXmlConvertible {
12
  use \Nette\SmartObject;
13
14
  public string $title;
15
  public string $description;
16
  public string $name;
17
  public string $link;
18
19
  public function __construct(string $title, string $description, string $name, string $link) {
20 1
    $this->title = $title;
21 1
    $this->description = $description;
22 1
    $this->name = $name;
23 1
    $this->link = $link;
24 1
  }
25
26
  public function appendToXml(\SimpleXMLElement &$parent): void {
27 1
    $element = $parent->addChild("textInput");
28 1
    $element->addChild("title", $this->title);
29 1
    $element->addChild("description", $this->description);
30 1
    $element->addChild("name", $this->name);
31 1
    $element->addChild("link", $this->link);
32 1
  }
33
}
34
?>