Completed
Push — master ( 4e2c55...2c21d8 )
by Andrey
01:28
created

Helper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isActiveTab() 0 4 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