Completed
Push — master ( a51ab2...247c5c )
by Antonio Carlos
03:22
created

HtmlString   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 40
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toHtml() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace IlluminateAgnostic\Str\Support;
4
5
use IlluminateAgnostic\Str\Contracts\Support\Htmlable;
6
7
class HtmlString implements Htmlable
8
{
9
    /**
10
     * The HTML string.
11
     *
12
     * @var string
13
     */
14
    protected $html;
15
16
    /**
17
     * Create a new HTML string instance.
18
     *
19
     * @param  string  $html
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22
    public function __construct($html)
23
    {
24
        $this->html = $html;
25
    }
26
27
    /**
28
     * Get the HTML string.
29
     *
30
     * @return string
31
     */
32
    public function toHtml()
33
    {
34
        return $this->html;
35
    }
36
37
    /**
38
     * Get the HTML string.
39
     *
40
     * @return string
41
     */
42
    public function __toString()
43
    {
44
        return $this->toHtml();
45
    }
46
}
47