DirectoryResourceIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

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