GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d7e77a...de0430 )
by Beñat
04:49
created

ToolAvailability::isAvailable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the CS library.
5
 *
6
 * Copyright (c) 2015-present LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LIN3S\CS\Checker;
13
14
use LIN3S\CS\Exception\ToolUnavailableException;
15
use Symfony\Component\Process\Process;
16
17
/**
18
 * @author Beñat Espiña <[email protected]>
19
 */
20
trait ToolAvailability
21
{
22
    public function isAvailable($tool)
23
    {
24
        $process = new Process(sprintf('%s -v', $tool));
25
        $process->run();
26
27
        if (!$process->isSuccessful()) {
28
            throw new ToolUnavailableException($tool);
29
        }
30
    }
31
}
32