Passed
Push — master ( d845af...25b359 )
by Bruno
08:11
created

ModelHiddenDirective   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A processModelTypeDirective() 0 4 1
A processModelFieldDirective() 0 7 1
A processModelRelationshipDirective() 0 5 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\Node $directive
13
    ): void {
14
    }
15
16
    public static function processModelFieldDirective(
17
        ModelGenerator $generator,
18
        \GraphQL\Type\Definition\FieldDefinition $field,
19
        \GraphQL\Language\AST\Node $directive
20
    ): void {
21
        $fieldName = $field->name;
22
        $generator->hidden[] = $fieldName;
23
    }
24
25
    public function processModelRelationshipDirective(
26
        ModelGenerator $generator,
27
        \GraphQL\Type\Definition\FieldDefinition $field,
28
        \GraphQL\Language\AST\Node $directive
29
    ): void {
30
    }
31
}
32