Completed
Push — master ( 0b917b...fc5a3e )
by Andrii
03:48
created

Bower   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 7
Bugs 1 Features 0
Metric Value
wmc 2
c 7
b 1
f 0
lcom 0
cbo 2
dl 0
loc 39
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fixConstraint() 0 8 2
1
<?php
2
3
/*
4
 * Composer plugin for bower/npm assets
5
 *
6
 * @link      https://github.com/hiqdev/composer-asset-plugin
7
 * @package   composer-asset-plugin
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\composerassetplugin;
13
14
/**
15
 * Bower package manager class.
16
 *
17
 * @author Andrii Vasyliev <[email protected]>
18
 */
19
class Bower extends PackageManager
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected $name = 'bower';
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public $file = 'bower.json';
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public $phpPackage = 'beelab/bowerphp';
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public $phpBin = 'bowerphp';
40
41
    /**
42
     * @var array Minimal bower config
43
     */
44
    protected $config = [
45
        'name'        => 'composer-asset-plugin',
46
        'description' => "This file is auto-generated with 'hiqdev/composer-asset-plugin'.",
47
    ];
48
49
    public function fixConstraint($constraint)
50
    {
51
        if (Constraint::isDisjunctive($constraint)) {
52
            $constraint = Constraint::findMax(explode($constraint, '|'));
53
        }
54
55
        return $constraint;
56
    }
57
}
58