TextInput   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 15
c 2
b 0
f 1
dl 0
loc 21
ccs 11
cts 11
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A appendToXml() 0 6 1
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
?>