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
Pull Request — master (#536)
by
unknown
19:46
created

IdFetcherCallback::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1.0019

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 22
ccs 7
cts 8
cp 0.875
rs 10
cc 1
nc 1
nop 2
crap 1.0019
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction\GraphQL\Relay;
6
7
use Overblog\GraphQLBundle\Definition\GlobalVariables;
8
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction;
9
use Overblog\GraphQLBundle\Generator\TypeGenerator;
10
11
final class IdFetcherCallback extends ExpressionFunction
12
{
13 129
    public function __construct(GlobalVariables $globalVariables, $name = 'idFetcherCallback')
14
    {
15 129
        parent::__construct(
16 129
            $name,
17
            function ($idFetcher) {
18 2
                $code = 'function ($value) use ('.TypeGenerator::USE_FOR_CLOSURES.', $args, $context, $info) { ';
19 2
                $code .= 'return '.$idFetcher.'; }';
20
21 2
                return $code;
22 129
            },
23
            // TODO: finish this callback
24
            function ($arguments, $idFetcher) use ($globalVariables): callable {
0 ignored issues
show
Unused Code introduced by
The import $globalVariables is not used and could be removed.

This check looks for imports that have been defined, but are not used in the scope.

Loading history...
Unused Code introduced by
The parameter $idFetcher is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
            function ($arguments, /** @scrutinizer ignore-unused */ $idFetcher) use ($globalVariables): callable {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $arguments is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
            function (/** @scrutinizer ignore-unused */ $arguments, $idFetcher) use ($globalVariables): callable {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
//                [
26
//                    'context' => $context,
27
//                    'args'    => $args,
28
//                    'info'    => $info
29
//                ] = $arguments;
30
//
31
//                return function ($value) use ($idFetcher, $globalVariables, $args, $context, $info) {
32
//                    return $idFetcher;
33
//                };
34
                throw new \RuntimeException("The expression function 'idFetcherCallback' is not yet finished and therefore is not allowed to be used.");
35 129
            }
36
        );
37 129
    }
38
}
39