Override::attribute()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace BestServedCold\HTMLBuilder\Html\Node;
4
5
use BestServedCold\HTMLBuilder\Html\Node;
6
7
/**
8
 * Class Override
9
 * 
10
 * @package BestServedCold\HTMLBuilder\Html\Node
11
 */
12
trait Override
13
{
14
    /**
15
     * @param  $type
16
     * @param  $string
17
     * @return Node
18
     */
19
    public abstract function attribute($type, $string);
20
21
    /**
22
     * @param string        $string
23
     * @param string|null   $type
24
     * @return Node
25
     */
26 1
    public function data($string, $type = null)
27
    {
28 1
        $type = $type ? 'data-' . $type : 'data';
29 1
        return $this->attribute($type, $string);
30
    }
31
32
    /**
33
     * @param  string|null $string
34
     * @return Node
35
     */
36 1
    public function acceptcharset($string = null)
37
    {
38 1
        return $this->attribute('accept-charset', $string);
39
    }
40
41
    /**
42
     * @param null $value
43
     * @return Node
44
     */
45 1
    public function contentAttribute($value = null)
46
    {
47 1
        return $this->attribute('content', $value);
48
    }
49
}
50