Completed
Push — master ( e4bfce...b9fe45 )
by Vladimir
02:19
created

FinderFunction::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace allejo\stakx\Twig;
4
5
use Symfony\Component\Finder\Finder;
6
use Twig_Environment;
7
8
class FinderFunction extends TwigFilesystem
9
{
10
    public function __invoke (Twig_Environment $env, $folderLocation)
11
    {
12
        parent::__invoke($env, $folderLocation);
13
14
        $finder = new Finder();
15
        $finder->in($folderLocation);
16
17
        return $finder;
18
    }
19
20 1
    public static function get ()
21
    {
22 1
        return new \Twig_SimpleFunction('finder', new self(), array(
23
            'needs_environment' => true
24 1
        ));
25
    }
26
}