Completed
Pull Request — master (#6)
by
unknown
25:42 queued 10:44
created

Symlink::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Automation tool mixed with code generator for easier continuous development
4
 *
5
 * @link      https://github.com/hiqdev/hidev
6
 * @package   hidev
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\components;
12
13
use hidev\helpers\FileHelper;
14
15
/**
16
 * Symlink component.
17
 *
18
 * @author Jomon Johnson <[email protected]>
19
 */
20
class Symlink extends File
21
{
22
    public $symlink;
23
24
25
    public function init()
26
    {
27
28
    }
29
30
    /**
31
     * General save: save and modify.
32
     */
33
    public function save()
34
    {
35
        if (!$this->once || !$this->exists()) {
36
            FileHelper::symlink($this->symlink, $this->_path);
37
        }
38
    }
39
40
}
41