Helper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isActiveTab() 0 3 2
1
<?php
2
3
namespace Itstructure\FieldWidgets\helpers;
4
5
use Itstructure\FieldWidgets\interfaces\LanguageFieldInterface;
6
7
/**
8
 * Class Helper
9
 *
10
 * @package Itstructure\FieldWidgets\helpers
11
 */
12
class Helper
13
{
14
    /**
15
     * Check if the current language is default, then set class "active" for tab.
16
     *
17
     * @param LanguageFieldInterface $language
18
     *
19
     * @return string
20
     */
21
    public static function isActiveTab(LanguageFieldInterface $language)
22
    {
23
        return $language->getDefault() == 1 ? 'active' : '';
24
    }
25
}
26