ConfigPlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 4
c 2
b 0
f 1
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A path() 0 9 2
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\helpers;
12
13
/**
14
 * Composer config plugin helper.
15
 */
16
class ConfigPlugin
17
{
18
    public static function path($name, $vendor)
19
    {
20
        /// doesn't work when dependencies are not installed
21
        /// return \hiqdev\composer\config\Builder::path($name, $vendor);
22
23
        $yiiPath = "$vendor/yiisoft/composer-config-plugin-output/$name.php";
24
        $hiqPath = "$vendor/hiqdev/composer-config-plugin-output/$name.php";
25
26
        return file_exists($yiiPath) ? $yiiPath : $hiqPath;
27
    }
28
}
29