Passed
Pull Request — master (#6)
by
unknown
10:31
created

Symlink::save()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 2
nc 2
nop 0
dl 0
loc 4
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\base\File as FileObj;
14
use hidev\helpers\Helper;
15
use Yii;
16
use yii\helpers\ArrayHelper;
17
use hidev\helpers\FileHelper;
18
19
/**
20
 * Symlink component.
21
 *
22
 * @author Jomon Johnson <[email protected]>
23
 */
24
class Symlink extends File
25
{
26
    public $symlink;
27
28
    /**
29
     * General save: save and modify.
30
     */
31
    public function save()
32
    {
33
        if (!$this->once || !$this->exists()) {
34
            FileHelper::symlink($this->symlink, $this->_path);
35
        }
36
    }
37
38
}
39