Completed
Pull Request — master (#38)
by Pádraic
02:50
created

PHPFinder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 3
1
<?php
2
3
namespace PHPMND;
4
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Finder\Finder;
7
8
/**
9
 * Class Finder
10
 *
11
 * @package PHPMND
12
 */
13
class PHPFinder extends Finder
14
{
15
    /**
16
     * @param InputInterface $input
17
     */
18
    public function __construct(InputInterface $input)
19
    {
20
        parent::__construct();
21
        $this
22
            ->files()
23
            ->in($input->getArgument('directory'))
24
            ->exclude(array_merge(['vendor'], $input->getOption('exclude')))
25
            ->name('*.php')
26
            ->ignoreDotFiles(true)
27
            ->ignoreVCS(true);
28
29
        foreach ($input->getOption('exclude-path') as $notPath) {
30
            $this->notPath($notPath);
31
        }
32
33
        foreach ($input->getOption('exclude-file') as $notName) {
34
            $this->notName($notName);
35
        }
36
    }
37
}
38