Photos::analyse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 34
rs 9.376
c 0
b 0
f 0
1
<?php
2
namespace Finder\Spider\Finder;
3
4
use Finder\Logic\Output\AbstractOutput;
5
use Finder\Logic\Output\Filter\OutputFilterInterface;
6
use Finder\Logic\Output\TriggerableInterface;
7
8
use Symfony\Component\Finder\Finder;
9
use Finder\Contracts\Spider\Spider;
10
11
use Support\Helps\DebugHelper;
12
13
/**
14
 * Run all script analysers and outputs their result.
15
 */
16
class Photos extends Spider
17
{
18
19
    public function analyse()
20
    {
21
22
        $finder = new Finder();
23
        
24
        // Selecionando Diretorio
25
        $finder->in($this->getTargetPath());
26
27
28
        $finder->files()->name(
29
            ['*.jpg', '*.png']
30
        );
31
32
        // $finder->files()->contains('sierra');
33
34
        DebugHelper::info('Fotos encontradas: '.$finder->count());
35
36
37
        foreach ($finder as $file)
38
        {
39
40
41
    
42
            DebugHelper::info("Endereço Completo: ".$file->getRealPath());
43
            DebugHelper::info("Nome: ".$file->getRelativePathname());
44
45
            dd('PhotosFinderoi');
46
47
48
49
            
50
        }
51
        // dd($finder);
52
    }
53
54
55
}