Completed
Pull Request — master (#294)
by De Cramer
03:48
created

PlayerListField   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getElementName() 0 8 2
1
<?php
2
3
namespace eXpansion\Framework\Config\Ui\Fields;
4
5
/**
6
 * Class PlayerListField
7
 *
8
 * @author    de Cramer Oliver<[email protected]>
9
 * @copyright 2018 Smile
10
 * @package eXpansion\Framework\Config\Ui\Fields
11
 */
12
class PlayerListField extends TextListField
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    protected function getElementName($element)
18
    {
19
        if (!empty($element->getNickName())) {
20
            return "{$element->getNickname()} {$element->getLogin()}";
21
        }
22
23
        return $element->getLogin();
24
    }
25
}