MigrationForeignDirective::definition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 27
c 1
b 0
f 0
dl 0
loc 3
ccs 1
cts 1
cp 1
rs 9.488
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Laravel\Lighthouse\Directives;
4
5
use Nuwave\Lighthouse\Schema\Directives\BaseDirective;
6
7
class MigrationForeignDirective extends BaseDirective
8
{
9 8
    public static function definition(): string
10
    {
11
        return /** @lang GraphQL */ <<<'SDL'
12 8
"""
13
Foreign keys
14
"""
15
directive @migrationForeign(
16
    """
17
    What field it references
18
    """
19
    references: String
20
21
    """
22
    What table it references
23
    """
24
    on: String
25
26
    """
27
    What to do onDelete
28
    """
29
    onDelete: String
30
31
    """
32
    What to do on Update
33
    """
34
    onUpdate: String
35
) on FIELD_DEFINITION
36
        
37
SDL;
38
    }
39
}
40