AbstractType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fields() 0 4 1
typeFields() 0 1 ?
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