Test Failed
Push — master ( 453945...60d866 )
by Florian
02:33
created

Utility::sanitizePath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0625
1
<?php
2
declare(strict_types = 1);
3
4
namespace Phauthentic\Presentation\Renderer;
5
6
/**
7
 * Utility
8
 */
9
class Utility
10
{
11
    /**
12
     * Sanitizes the template path
13
     *
14
     * @param string $path
15
     * @return string
16
     */
17 3
    public static function sanitizePath(string $path): string
18
    {
19 3
        if (DIRECTORY_SEPARATOR === '\\') {
20
            return str_replace('/', '\\', $path);
21
        }
22
23 3
        return str_replace('\\', '/', $path);
24
    }
25
}
26