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

Bower::fixConstraint()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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