LtGtEncode::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Matecat\SubFiltering\Filters;
4
5
use Matecat\SubFiltering\Commons\AbstractHandler;
6
7
class LtGtEncode extends AbstractHandler {
8
9 85
    public function transform( string $segment ): string {
10
        // restore < e >
11 85
        $segment = str_replace( "<", "&lt;", $segment );
12
13 85
        return str_replace( ">", "&gt;", $segment );
14
    }
15
16
}