GraphQLSchema   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 12 2
1
<?php
2
3
namespace DeInternetJongens\LighthouseUtils\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class GraphQLSchema extends Model
8
{
9
    protected $table = 'graphql_schema';
10
11
    protected $guarded = ['id'];
12
13
    public static function register($action, $model, $type, $permission = null)
14
    {
15
        if (config('lighthouse-utils.authorization')) {
16
            return static::create([
17
                'name' => $action,
18
                'type' => $type,
19
                'model' => $model,
20
                'permission' => $permission,
21
            ]);
22
        }
23
24
        return null;
25
    }
26
}
27