EntryContent::getVersion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Osnova\Services\Timeline;
4
5
use Osnova\Services\ServiceEntity;
6
7
class EntryContent extends ServiceEntity
8
{
9
    /**
10
     * Get HTML value of entry content.
11
     *
12
     * @return string|null
13
     */
14
    public function getHtml()
15
    {
16
        return $this->getData('html') ?? '';
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getData('html') ?? '' also could return the type array which is incompatible with the documented return type null|string.
Loading history...
17
    }
18
19
    /**
20
     * Get entry content's version.
21
     *
22
     * @return string|null
23
     */
24
    public function getVersion()
25
    {
26
        return $this->getData('version') ?? '';
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getData('version') ?? '' also could return the type array which is incompatible with the documented return type null|string.
Loading history...
27
    }
28
29
    /**
30
     * Transform current content instance to string representation.
31
     *
32
     * @return string
33
     */
34
    public function __toString()
35
    {
36
        return $this->getHtml() ?? '';
37
    }
38
}
39