| Total Complexity | 6 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class Timestamp extends Element |
||
| 10 | { |
||
| 11 | public const NAME = 'Timestamp'; |
||
| 12 | |||
| 13 | protected ?Created $created; |
||
| 14 | |||
| 15 | protected ?Expires $expires; |
||
| 16 | |||
| 17 | 2 | public function __construct(string $namespace = self::NS_WSU) |
|
| 18 | { |
||
| 19 | 2 | parent::__construct(self::NAME, $namespace); |
|
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Overrides method in order to add created and expires values if they are set. |
||
| 24 | * |
||
| 25 | * @param bool $asDomElement returns elements as a DOMElement or as a string |
||
| 26 | * |
||
| 27 | * @return DOMElement|false|string |
||
| 28 | */ |
||
| 29 | 2 | protected function __toSend(bool $asDomElement = false) |
|
| 30 | { |
||
| 31 | 2 | $this->setValue([ |
|
| 32 | 2 | $this->getCreated(), |
|
| 33 | 2 | $this->getExpires(), |
|
| 34 | ]); |
||
| 35 | |||
| 36 | 2 | return parent::__toSend($asDomElement); |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | public function getCreated(): ?Created |
|
| 40 | { |
||
| 41 | 2 | return $this->created; |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | public function setCreated(Created $created): self |
|
| 49 | } |
||
| 50 | |||
| 51 | 2 | public function getExpires(): ?Expires |
|
| 54 | } |
||
| 55 | |||
| 56 | 2 | public function setExpires(Expires $expires): self |
|
| 61 | } |
||
| 62 | } |
||
| 63 |