Email   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A formatHref() 0 4 1
A getAnchor() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Grido (https://github.com/o5/grido)
5
 *
6
 * Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
7
 *
8
 * For the full copyright and license information, please view
9
 * the file LICENSE.md that was distributed with this source code.
10
 */
11
12
namespace Grido\Components\Columns;
13
14
/**
15
 * Email column.
16
 *
17
 * @package     Grido
18
 * @subpackage  Components\Columns
19
 * @author      Petr Bugyík
20
 */
21
class Email extends Link
22 1
{
23
    /**
24
     * @param string $value
25
     * @return string
26
     */
27
    protected function formatHref($value)
28
    {
29 1
        return "mailto:" . $value;
30
    }
31
32
    /**
33
     * @param mixed $value
34
     * @return \Nette\Utils\Html
35
     */
36
    protected function getAnchor($value)
37
    {
38 1
        $anchor = parent::getAnchor($value);
39 1
        unset($anchor->attrs['target']);
40 1
        unset($anchor->attrs['rel']);
41
42 1
        return $anchor;
43
    }
44
}
45