Completed
Push — master ( 3444d0...2c4de3 )
by Andrii
12:14
created

Symlink   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 4 3
A init() 0 2 1
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