Img   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
A tagName() 0 4 1
1
<?php
2
3
namespace hemio\html;
4
5
/**
6
 * The img element represents an image.
7
 *
8
 * @since version 1.0
9
 * @url http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element
10
 */
11
class Img extends Abstract_\ElementEmpty
12
{
13
14
    public function __construct($url = null, $alt = null)
15
    {
16
        if ($url !== null) {
17
            $this->setAttribute('src', $url);
18
        }
19
        if ($alt !== null) {
20
            $this->setAttribute('alt', $alt.' ');
21
        }
22
    }
23
24
    public static function tagName()
25
    {
26
        return 'img';
27
    }
28
}
29