ModelHiddenDirective::processModelFieldDirective()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 8
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Laravel\Directives;
4
5
use Modelarium\Laravel\Targets\ModelGenerator;
6
use Modelarium\Laravel\Targets\Interfaces\ModelDirectiveInterface;
7
8
class ModelHiddenDirective implements ModelDirectiveInterface
9
{
10
    public static function processModelTypeDirective(
11
        ModelGenerator $generator,
12
        \GraphQL\Language\AST\DirectiveNode $directive
13
    ): void {
14
    }
15
16
    public static function processModelFieldDirective(
17
        ModelGenerator $generator,
18
        \GraphQL\Type\Definition\FieldDefinition $field,
19
       \Formularium\Field $fieldFormularium,
20
        \GraphQL\Language\AST\DirectiveNode $directive
21
    ): void {
22
        $fieldName = $field->name;
23
        $generator->hidden[] = $fieldName;
24
    }
25
26
    public static function processModelRelationshipDirective(
27
        ModelGenerator $generator,
28
        \GraphQL\Type\Definition\FieldDefinition $field,
29
        \GraphQL\Language\AST\DirectiveNode $directive,
30
        \Formularium\Datatype $datatype = null
31
    ): ?\Formularium\Datatype {
32
        return null;
33
    }
34
}
35