Passed
Push — master ( 1c0242...3e6a4b )
by Bruno
10:24
created

Util   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 9
c 1
b 1
f 0
dl 0
loc 14
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldShow() 0 12 4
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Frontend;
4
5
use Formularium\Field;
6
7
final class Util
8
{
9
    public static function fieldShow(Field $f): bool
10
    {
11
        if ($f->getExtradata('modelHidden') !== null) {
12
            return false;
13
        }
14
        $show = $f->getRenderable('show', null);
15
        if ($show === true) {
16
            return true;
17
        } elseif ($show === true) {
18
            return false;
19
        }
20
        return !empty($f->getRenderables());
21
    }
22
}
23