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

Completed
Push — annotations ( a85f92...4ec00b )
by Jérémiah
24:35 queued 10s
created

ClassUtils   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A shortenClassFromCode() 0 11 2
A __construct() 0 2 1
A cleanClasseName() 0 3 1
A shortenClassName() 0 5 1
1
<?php
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
    public static function shortenClassName($definition)
24
    {
25
        $shortName = \substr($definition, \strrpos($definition, '\\') + 1);
26
27
        return $shortName;
28
    }
29
30
    public static function shortenClassFromCode($code, callable $callback = null)
31
    {
32
        if (null === $callback) {
33
            $callback = function ($matches) {
34
                return static::shortenClassName($matches[1]);
35
            };
36
        }
37
38
        $codeParsed = \preg_replace_callback('@((?:\\\\{1,2}\w+|\w+\\\\{1,2})(?:\w+\\\\{0,2})+)@', $callback, $code);
39
40
        return $codeParsed;
41
    }
42
43
    public static function cleanClasseName($use)
44
    {
45
        return \ltrim($use, '\\');
46
    }
47
}
48