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

Page::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 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