RssEscape::escape()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: ninoskopac
5
 * Date: 02/05/2018
6
 * Time: 00:02
7
 */
8
declare(strict_types=1);
9
namespace iTunesPodcastFeed\Traits;
10
11
trait RssEscape {
12
    protected function escape(string $str): string {
13
        // https://stackoverflow.com/a/11787940/1325575
14
        $str = str_replace(array('&', '<'), array('&#x26;', '&#x3C;'), $str);
15
16
        return $str;
17
    }
18
}