TdbmObjectType   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFieldList() 0 4 1
A showAll() 0 6 2
A hideAll() 0 6 2
1
<?php
2
3
4
namespace TheCodingMachine\Tdbm\GraphQL;
5
6
use Youshido\GraphQL\Type\Object\AbstractObjectType;
7
8
abstract class TdbmObjectType extends AbstractObjectType
9
{
10
    /**
11
     * Returns the list of fields coming from TDBM beans.
12
     *
13
     * @return Field[]
14
     */
15
    protected function getFieldList(): array
16
    {
17
        return [];
18
    }
19
20
    protected function showAll(): void
21
    {
22
        foreach ($this->getFieldList() as $field) {
23
            $field->show();
24
        }
25
    }
26
27
    protected function hideAll(): void
28
    {
29
        foreach ($this->getFieldList() as $field) {
30
            $field->hide();
31
        }
32
    }
33
}
34