Project::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16

Duplication

Lines 16
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 16
loc 16
rs 9.7333
c 0
b 0
f 0
1
<?php
2
3
namespace Finder\Pipelines\Finder;
4
5
use Operador\Contracts\Stage as StageBase;
6
use Finder\Pipelines\Builders\RepositoryBuilder;
7
8 View Code Duplication
class Project extends StageBase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    protected $finder = false;
11
12
    // Have
13
    protected $files = [];
14
    protected $directorys = [];
15
16
17
    public function __invoke($payload)
18
    {
19
        // find all files in the current directory
20
        $targetPath = $payload->getTargetPath();
21
        $this->info('Analisando Projeto: '.$targetPath);
22
23
        if(file_exists($targetPath.'/.git')) {
24
            $pipeline = RepositoryBuilder::getPipelineWithOutput($this->getOutput());
25
            // Process Pipeline
26
            return $pipeline(
27
                \Fabrica\Entities\RepositoryEntity::make($payload)
28
            );
29
        }
30
31
        return $payload;
32
    }
33
}