Completed
Push — symfony-console ( 6e7652...a3a24c )
by Arnaud
01:56
created

FilenameRecursiveTreeIterator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A current() 0 8 1
1
<?php
2
/*
3
 * This file is part of the Cecil/Cecil package.
4
 *
5
 * Copyright (c) Arnaud Ligny <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cecil\Command\ShowContent;
12
13
use RecursiveTreeIterator;
14
15
/**
16
 * Replace Filepath by Filename.
17
 *
18
 * Class FilenameRecursiveTreeIterator
19
 */
20
class FilenameRecursiveTreeIterator extends RecursiveTreeIterator
21
{
22
    /**
23
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use string.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
24
     */
25
    public function current()
26
    {
27
        return str_replace(
28
            $this->getInnerIterator()->current(),
29
            substr(strrchr($this->getInnerIterator()->current(), DIRECTORY_SEPARATOR), 1),
30
            parent::current()
31
        );
32
    }
33
}
34