Utility::sanitizePath()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 0
ccs 3
cts 4
cp 0.75
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