Completed
Push — master ( cf3ebd...a15255 )
by Marcel
02:52
created

HeaderNameNormalizer::normalize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
3
namespace UMA\Psr7Hmac\Internal;
4
5
6
class HeaderNameNormalizer
7
{
8
    /**
9
     * @param string $name
10
     *
11
     * @return string
12
     */
13 191
    public function normalize($name)
14
    {
15 191
        $normalized = mb_strtolower($name);
16
17 191
        if (0 === strpos($normalized, 'http_')) {
18 2
            $normalized = str_replace('_', '-', substr($normalized, 5));
19 2
        }
20
21 191
        return $normalized;
22
    }
23
}
24