Failed Conditions
Pull Request — master (#13)
by Adrien
05:33 queued 02:11
created

AclPrivilegeConfigurationType   A

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
eloc 18
c 1
b 0
f 0
dl 0
loc 28
ccs 0
cts 8
cp 0
rs 10
wmc 1

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
class AclPrivilegeConfigurationType extends ObjectType
10
{
11
    public function __construct()
12
    {
13
        $config = [
14
            'name' => 'AclPrivilegeConfiguration',
15
            'description' => 'Describe an ACL privilege configuration',
16
            'fields' => [
17
                'privilege' => [
18
                    'type' => self::string(),
19
                    'description' => 'Name of the ACL privilege',
20
                ],
21
                'allowed' => [
22
                    'type' => self::nonNull(self::boolean()),
23
                    'description' => 'Whether the privilege is allowed',
24
                ],
25
                'allowIf' => [
26
                    'type' => self::nonNull(self::listOf(self::nonNull(self::string()))),
27
                    'description' => 'List of all human readable conditions that would allow the privilege',
28
                ],
29
                'denyIf' => [
30
                    'type' => self::nonNull(self::listOf(self::nonNull(self::string()))),
31
                    'description' => 'List of all human readable conditions that would allow the privilege',
32
                ],
33
            ],
34
        ];
35
36
        parent::__construct($config);
37
    }
38
}
39