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.

Detector::detect()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 2
1
<?php
2
3
namespace Jamal\JenkinsArduino\Serial;
4
5
/**
6
 * @author Caio Almeida <[email protected]>
7
 */
8
class Detector
9
{
10
    /**
11
     * @param  string $usbType
12
     * @param  int $usbCount
13
     * @return string
14
     */
15
    public function detect($usbType, $usbCount)
16
    {
17
        for ($i = 0; $i <= $usbCount; $i++) {
18
            $port = $usbType . $i;
19
            if (is_readable($port)) {
20
                return $port;
21
            }
22
        }
23
24
        throw new PortNotDetectedException();
25
    }
26
}
27