UrlFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 3 2
1
<?php
2
3
namespace Itstructure\DetailView\Formatters;
4
5
/**
6
 * Class UrlFormatter
7
 * @package Itstructure\DetailView\Formatters
8
 */
9
class UrlFormatter extends BaseFormatter
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $title = '';
15
16
    /**
17
     * Format value as url.
18
     * @param $value
19
     * @return mixed|string
20
     */
21
    public function format($value)
22
    {
23
        return '<a href="' . $value . '" ' . $this->buildHtmlAttributes() . ' >' . !empty($this->title) ? $this->title : $value . '</a>';
24
    }
25
}
26