DirectoryResourceIterator::current()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Goetas\TwitalBundle\Assetic\Factory;
4
5
use Symfony\Component\Templating\Loader\LoaderInterface;
6
7
class DirectoryResourceIterator extends \RecursiveIteratorIterator
8
{
9
    protected $loader;
10
11
    protected $bundle;
12
13
    protected $path;
14
15
    /**
16
     * @param LoaderInterface $loader The templating loader
17
     * @param string $path The directory
18
     * @param \RecursiveIterator $iterator The inner iterator
19
     */
20
    public function __construct(LoaderInterface $loader, $path, \RecursiveIterator $iterator)
21
    {
22
        $this->loader = $loader;
23
        $this->path = $path;
24
25
        parent::__construct($iterator);
26
    }
27
28
    public function current()
29
    {
30
        $file = parent::current();
31
32
        return new FileResource($this->loader, $this->path, $file->getPathname());
33
    }
34
}
35