User::__toString()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
namespace Germania\Users;
3
4
5
6
class User extends UserAbstract implements UserInterface
7
{
8
9
    /**
10
     * @return string The user display or login name
11
     */
12 15
    public function __toString()
13
    {
14 15
        return $this->getDisplayName() ?: $this->getLoginName();
15
    }
16
17
18
    /**
19
     * Returns a concatenation of the users' first and last name.
20
     *
21
     * @return string
22
     * @uses   getFirstName()
23
     * @uses   getLastName()
24
     */
25 5
    public function getFullName() {
26 5
        return trim($this->getFirstName() . ' ' . $this->getLastName());
27
    }
28
29
30
31
}
32