Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — 0.13 ( b4314d...04b0f5 )
by Jérémiah
54:30 queued 33:21
created

ClassUtils::shortenClassFromCode()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 2
crap 3
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the OverblogGraphQLPhpGenerator package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
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 Overblog\GraphQLGenerator;
13
14
abstract class ClassUtils
15
{
16
    /**
17
     * @codeCoverageIgnore
18
     */
19
    private function __construct()
20
    {
21
    }
22
23 174
    public static function shortenClassName($definition)
24
    {
25 174
        $shortName = \substr($definition, \strrpos($definition, '\\') + 1);
26
27 174
        return $shortName;
28
    }
29
30 52
    public static function shortenClassFromCode($code, callable $callback = null)
31
    {
32 52
        if (null === $code) {
33 2
            return '';
34
        }
35
36 51
        if (null === $callback) {
37
            $callback = function ($matches) {
38 2
                return static::shortenClassName($matches[1]);
39 2
            };
40
        }
41
42 51
        $codeParsed = \preg_replace_callback('@((?:\\\\{1,2}\w+|\w+\\\\{1,2})(?:\w+\\\\{0,2})+)@', $callback, $code);
43
44 51
        return $codeParsed;
45
    }
46
47 182
    public static function cleanClasseName($use)
48
    {
49 182
        return \ltrim($use, '\\');
50
    }
51
}
52