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

File::link()   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 1
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
}