Completed
Push — 2.0 ( d39b3c...f2914f )
by Kirill
02:52
created

TipType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
B typeFields() 0 29 1
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\GraphQL\Types;
10
11
use GraphQL\Type\Definition\Type;
12
13
/**
14
 * Class TipType.
15
 */
16
class TipType extends AbstractType
17
{
18
    /**
19
     * @var array
20
     */
21
    protected $attributes = [
22
        'name'        => 'Tip',
23
        'description' => 'Tip object',
24
    ];
25
26
    /**
27
     * @return array
28
     */
29
    public function typeFields(): array
30
    {
31
        return [
32
            'id'             => [
33
                'type'        => Type::nonNull(Type::id()),
34
                'description' => 'Tag identifier',
35
            ],
36
            'content'        => [
37
                'type'        => Type::nonNull(Type::string()),
38
                'description' => 'Tip rendered content',
39
            ],
40
            'content_source' => [
41
                'type'        => Type::nonNull(Type::string()),
42
                'description' => 'Tip content source (original)',
43
            ],
44
            'user'           => [
45
                'type'        => \GraphQL::type('User'),
46
                'description' => 'Tip author',
47
            ],
48
            'likes'          => [
49
                'type'        => Type::nonNull(Type::int()),
50
                'description' => 'Tip likes count',
51
            ],
52
            'dislikes'       => [
53
                'type'        => Type::nonNull(Type::int()),
54
                'description' => 'Tip dislikes count',
55
            ],
56
        ];
57
    }
58
}
59