Passed
Pull Request — master (#284)
by
unknown
02:13
created

ObjectType::toType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
namespace DNADesign\Elemental\GraphQL\Types;
3
4
use GraphQL\Type\Definition\CustomScalarType;
0 ignored issues
show
Bug introduced by
The type GraphQL\Type\Definition\CustomScalarType was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use SilverStripe\GraphQL\TypeCreator;
0 ignored issues
show
Bug introduced by
The type SilverStripe\GraphQL\TypeCreator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class ObjectType extends TypeCreator
8
{
9
    public function toType()
10
    {
11
        return new CustomScalarType([
12
            'name' => 'ObjectType',
13
            'serialize' => function ($value) {
14
                return (object) $value;
15
            },
16
            'parseValue' => function ($value) {
17
                return (array) $value;
18
            },
19
            'parseLiteral' => function ($ast) {
20
                return $ast->value;
21
            },
22
        ]);
23
    }
24
}
25