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

NormalizeIterator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
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 16
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

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