StringHelper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A replacePlaceHolders() 0 8 2
A sanitizeSerialized() 0 7 1
1
<?php namespace Tequilarapido\Helpers;
2
3
class StringHelper
4
{
5
    public static function replacePlaceHolders($string, $data)
6
    {
7
        foreach ($data as $key => $value) {
8
            $string = str_replace('@' . $key . '@', $value, $string);
9
        }
10
11
        return $string;
12
    }
13
14
15
    public static function sanitizeSerialized($string)
16
    {
17
        $string = str_replace('\"', '"', $string);
18
        $string = str_replace('"', '\"', $string);
19
20
        return $string;
21
    }
22
23
}