Completed
Pull Request — master (#6)
by
unknown
12:11
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
    /**
27
     * @var list destimation
0 ignored issues
show
Bug introduced by
The type hidev\components\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
     */
29
    public $dest;
30
31
    /**
32
     * General save: save and modify.
33
     */
34
    public function save()
35
    {
36
        if (!$this->once || !$this->exists()) {
37
            FileHelper::symlink($this->dest, $this->_path);
38
        }
39
    }
40
41
}
42