Completed
Push — master ( ab60f2...c901a1 )
by Ricardo
07:00
created

File   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isDirectory() 0 4 1
A link() 0 4 1
A move() 0 4 1
A copy() 0 10 2
1
<?php
2
3
namespace Fabrica\Task\External\Shell;
4
5
/**
6
 * Ln Criar Link Simbolico
7
 */
8
9
class File
10
{
11
    protected $path = false;
12
13
    protected $directory = false;
14
    
15
    public function isDirectory()
16
    {
17
        return $this->directory;
18
    }
19
    
20
    public function link($target)
21
    {
22
        return 'ln -s '.$this->path.' '.$target;
23
    }
24
    
25
    public function move($target)
26
    {
27
        return 'mv '.$this->path.' '.$target;
28
    }
29
    
30
    public function copy($target)
31
    {
32
        $options = '';
33
34
        if ($this->isDirectory()) {
35
            $options = ' -r';
36
        }
37
38
        return 'cp '.$this->path.' '.$target.$options;
39
    }
40
}