Completed
Push — master ( 90d2ed...93cf6b )
by Ricardo
04:10
created

DirectoryEntity   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTargetPath() 0 4 1
B isProject() 0 20 6
1
<?php
2
3
namespace Fabrica\Entities;
4
5
6
class DirectoryEntity extends EntityAbstract
7
{
8
    public $files = [];
9
    public $directorys = [];
10
    
11
    /**
12
     * Return diretory path
13
     *
14
     * @return string
15
     */
16
    public function getTargetPath(): string
17
    {
18
        return $this->code;
19
    }
20
21
    public function isProject(): bool
22
    {
23
        if (file_exists($this->getTargetPath().'/.git')) {
24
            return true;
25
        }
26
        if (file_exists($this->getTargetPath().'/.gitignore')) {
27
            return true;
28
        }
29
        if (file_exists($this->getTargetPath().'/pubspec.yaml')) {
30
            return true;
31
        }
32
        if (file_exists($this->getTargetPath().'/composer.json')) {
33
            return true;
34
        }
35
        if (file_exists($this->getTargetPath().'/package.json')) {
36
            return true;
37
        }
38
39
        return false;
40
    }
41
}