Completed
Pull Request — master (#2)
by Adam
01:53
created

Override   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A data() 0 5 2
A acceptcharset() 0 4 1
A contentAttribute() 0 4 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 string        $string
16
     * @param string|null   $type
17
     * @return Node
18
     */
19
    public function data($string, $type = null)
20
    {
21
        $type = $type ? 'data-' . $type : 'data';
22
        return $this->attribute($type, $string);
0 ignored issues
show
Bug introduced by
The method attribute() does not exist on BestServedCold\HTMLBuilder\Html\Node\Override. Did you maybe mean contentAttribute()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
23
    }
24
25
    /**
26
     * @param  string|null $string
27
     * @return Node
28
     */
29
    public function acceptcharset($string = null)
30
    {
31
        return $this->attribute('accept-charset', $string);
0 ignored issues
show
Bug introduced by
The method attribute() does not exist on BestServedCold\HTMLBuilder\Html\Node\Override. Did you maybe mean contentAttribute()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
    }
33
34
    /**
35
     * @param null $value
36
     * @return Node
37
     */
38
    public function contentAttribute($value = null)
39
    {
40
        return $this->attribute('content', $value);
0 ignored issues
show
Bug introduced by
The method attribute() does not exist on BestServedCold\HTMLBuilder\Html\Node\Override. Did you maybe mean contentAttribute()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
41
    }
42
}
43