ConfigPlugin::path()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 2
b 0
f 1
nc 2
nop 2
dl 0
loc 9
ccs 0
cts 4
cp 0
crap 6
rs 10
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