MemberTokenTypeCreator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 4 1
A fields() 0 9 1
1
<?php declare(strict_types=1);
2
3
namespace Firesphere\GraphQLJWT\Types;
4
5
use GraphQL\Type\Definition\Type;
6
use SilverStripe\GraphQL\TypeCreator;
7
8
/**
9
 * Represents a member / token pair
10
 */
11
class MemberTokenTypeCreator extends TypeCreator
12
{
13
    public function attributes(): array
14
    {
15
        return [
16
            'name' => 'MemberToken'
17
        ];
18
    }
19
20
    public function fields(): array
21
    {
22
        return [
23
            'Valid'   => ['type' => Type::boolean()],
24
            'Member'  => ['type' => $this->manager->getType('Member')],
25
            'Token'   => ['type' => Type::string()],
26
            'Status'  => ['type' => TokenStatusEnum::instance()],
27
            'Code'    => ['type' => Type::int()],
28
            'Message' => ['type' => Type::string()],
29
        ];
30
    }
31
}
32