UndefinedApplicationUser   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 61
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getName() 0 4 1
A getPreferredLanguage() 0 4 1
A __construct() 0 4 1
A getThirdPartyAccount() 0 8 2
1
<?php
2
3
namespace MessageApp\User;
4
5
use MessageApp\User\ThirdParty\Account;
6
use MessageApp\User\ThirdParty\Source;
7
8
class UndefinedApplicationUser implements ApplicationUser
9
{
10
    /**
11
     * @var Account
12
     */
13
    protected $account;
14
15
    /**
16
     * Constructor
17
     *
18
     * @param Account $account
19
     */
20 24
    public function __construct(Account $account)
21
    {
22 24
        $this->account = $account;
23 24
    }
24
25
    /**
26
     * Returns the id
27
     *
28
     * @return ApplicationUserId
29
     */
30 3
    public function getId()
31
    {
32 3
        return null;
33
    }
34
35
    /**
36
     * Returns the name
37
     *
38
     * @return string
39
     */
40 9
    public function getName()
41
    {
42 9
        return null;
43
    }
44
45
    /**
46
     * Returns the preferred language
47
     *
48
     * @return string
49
     */
50 3
    public function getPreferredLanguage()
51
    {
52 3
        return 'en';
53
    }
54
55
    /**
56
     * @param Source $source
57
     *
58
     * @return Account
59
     */
60 6
    public function getThirdPartyAccount(Source $source)
61
    {
62 6
        if ($source != $this->account->getSource()) {
63 3
            return null;
64
        }
65
66 3
        return $this->account;
67
    }
68
}
69