Completed
Pull Request — 2.x (#402)
by
unknown
03:02 queued 01:10
created

NormalizeIterator::current()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 9.9666
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
    {
23
        /* @var $symfonyFileInfo \Symfony\Component\Finder\SplFileInfo */
24
        $symfonyFileInfo = parent::current();
25
        $originalPath = $symfonyFileInfo->getPathname();
26
        $newPath = str_replace(DIRECTORY_SEPARATOR, '/', $originalPath);
27
28
        return new SplFileInfo($newPath);
29
    }
30
}
31