AbstractType::fields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of laravel.su package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
declare(strict_types=1);
10
11
namespace App\GraphQL\Types;
12
13
use App\GraphQL\Feature\EnumsSupport;
14
use App\GraphQL\Feature\Kernel\FeaturesSupport;
15
use Folklore\GraphQL\Support\Type as GraphQLType;
16
17
/**
18
 * Class AbstractType.
19
 */
20
abstract class AbstractType extends GraphQLType
21
{
22
    use EnumsSupport;
23
    use FeaturesSupport;
24
25
    /**
26
     * AbstractType constructor.
27
     * @param array $attributes
28
     */
29
    public function __construct($attributes = [])
30
    {
31
        $this->boot();
32
        parent::__construct($attributes = []);
33
    }
34
35
    /**
36
     * @return array
37
     */
38
    public function fields(): array
39
    {
40
        return $this->extendFields($this->typeFields());
41
    }
42
43
    /**
44
     * @return array
45
     */
46
    abstract public function typeFields(): array;
47
}
48