Hex::toStr()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace FForattini\Btrieve;
4
5
class Hex
6
{
7
    public static function toStr($hex)
8
    {
9
        $str = '';
10
        for ($i = 0; $i < strlen($hex); $i += 2) {
11
            $str .= chr(hexdec(substr($hex, $i, 2)));
12
        }
13
14
        return $str;
15
    }
16
}
17