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

DirectoryEntity::getTargetPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}