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

NormalizeIterator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A current() 0 8 1
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