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.

FileSystemHelper::isAbsolute()   B
last analyzed

Complexity

Conditions 6
Paths 6

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 6
nc 6
nop 1
crap 6
1
<?php
2
3
/*
4
 * This file is part of the composer-changelogs project.
5
 *
6
 * (c) Loïck Piera <[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 Pyrech\ComposerChangelogs\Util;
13
14
/**
15
 * Provides helper methods to ease file and path handling.
16
 */
17
class FileSystemHelper
18
{
19
    /**
20
     * Inspired from Symfony Filesystem component.
21
     *
22
     * @param string $file
23
     *
24
     * @return bool
25
     */
26 12
    public static function isAbsolute($file)
27
    {
28 12
        return strspn($file, '/\\', 0, 1)
29 10
            || (strlen($file) > 3 && ctype_alpha($file[0])
30 10
                && substr($file, 1, 1) === ':'
31 10
                && strspn($file, '/\\', 2, 1)
32 2
            )
33 10
            || null !== parse_url($file, PHP_URL_SCHEME)
34 12
        ;
35
    }
36
}
37