PermissionsType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 18
c 1
b 0
f 0
dl 0
loc 28
ccs 0
cts 24
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 26 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\Api\Output;
6
7
use GraphQL\Type\Definition\ObjectType;
8
9
final class PermissionsType extends ObjectType
10
{
11
    public function __construct()
12
    {
13
        $config = [
14
            'name' => 'Permissions',
15
            'description' => 'Describe permissions for current user',
16
            'fields' => [
17
                'create' => [
18
                    'type' => self::nonNull(self::boolean()),
19
                    'description' => 'Whether the current logged in user can create',
20
                ],
21
                'read' => [
22
                    'type' => self::nonNull(self::boolean()),
23
                    'description' => 'Whether the current logged in user can read',
24
                ],
25
                'update' => [
26
                    'type' => self::nonNull(self::boolean()),
27
                    'description' => 'Whether the current logged in user can update',
28
                ],
29
                'delete' => [
30
                    'type' => self::nonNull(self::boolean()),
31
                    'description' => 'Whether the current logged in user can delete',
32
                ],
33
            ],
34
        ];
35
36
        parent::__construct($config);
37
    }
38
}
39