Completed
Push — master ( 142578...5f4f14 )
by Igor
06:03
created

Page   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A title() 0 5 2
A clear() 0 5 1
1
<?php
2
3
namespace app\helpers;
4
5
use yii\helpers\Html;
6
7
class Page
8
{
9
    /**
10
     * Make page title
11
     *
12
     * @param string $title
13
     * @param string $appendToEnd
14
     * @return string
15
     */
16 216
    public static function title($title = '', $appendToEnd = '')
17
    {
18 216
        $title = $title ? self::clear($title) . ' / ' : '';
19 216
        return Html::tag('title', $title . $appendToEnd);
20
    }
21
22 203
    private static function clear($text)
23
    {
24 203
        $text = str_replace('"', '“', $text);
25 203
        return Html::encode(html_entity_decode(strip_tags($text)));
26
    }
27
}
28