ModelHiddenDirective   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 25
ccs 0
cts 8
cp 0
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A processModelTypeDirective() 0 4 1
A processModelFieldDirective() 0 8 1
A processModelRelationshipDirective() 0 7 1
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