Completed
Pull Request — 2.x (#402)
by
unknown
01:59
created

NormalizeIterator::current()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * @author Martin Fris <[email protected]>
6
 */
7
8
namespace Go\Instrument\FileSystem;
9
10
use IteratorIterator;
11
12
/**
13
 *
14
 */
15
final class NormalizeIterator extends IteratorIterator
16
{
17
18
    /**
19
     * @return SplFileInfo
20
     */
21
    public function current() {
22
        /* @var $symfonyFileInfo \Symfony\Component\Finder\SplFileInfo */
23
        $symfonyFileInfo = parent::current();
24
        $originalPath = $symfonyFileInfo->getPathname();
25
        $newPath = str_replace(DIRECTORY_SEPARATOR, '/', $originalPath);
26
27
        return new SplFileInfo($newPath);
28
    }
29
}
30