ComposerFile::collectDataEstrutura()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
1
<?php
2
namespace Finder\Spider\Identificadores;
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
use Stalker\Models\File;
11
use Finder\Models\Digital\Internet\ComputerFile;
12
13
use Finder\Contracts\Spider\IdentificadorManager;
14
15
/**
16
 * Run all script analysers and outputs their result.
17
 */
18
class ComposerFile extends IdentificadorManager
19
{
20
21
    /**
22
     * Identificar Group para a Pasta Pai
23
     */
24
    public static $groups = [
25
        \Finder\Spider\Groups\Project::class,
26
    ];
27
28
    /**
29
     * If is Composer Package
30
     */
31
    public function identify()
32
    {
33
        if ($this->getFile()->getFilename()!=='composer.json') {
34
            return false;
35
        }
36
37
        return true;
38
    }
39
40
    public function collectDataEstrutura()
41
    {
42
        return [
43
            "name",
44
            "description",
45
            "license",
46
            "authors" => [
47
                "name",
48
                "email",
49
            ],
50
            "require" => [
51
                "project" => 'version'
52
            ],
53
        ];
54
    }
55
}