Completed
Push — master ( 435061...8e7c43 )
by Ronan
01:16
created

Utils::unDecorate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
namespace IsoCodes;
4
5
/**
6
 * Utils
7
 */
8
class Utils
9
{
10
    /**
11
     * @param string $input
12
     * @param array  $hyphens
13
     *
14
     * @return string
15
     */
16
    public static function unDecorate($input, $hyphens = [])
17
    {
18
        $hyphensLength = count($hyphens);
19
        // removing hyphens
20
        for ($i = 0; $i < $hyphensLength; ++$i) {
21
            $input = str_replace($hyphens[$i], '', $input);
22
        }
23
24
        return $input;
25
    }
26
}
27