Completed
Push — master ( ec0b76...22789e )
by Craig
06:04
created

IdentityProfileModule::getAvatar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Zikula package.
5
 *
6
 * Copyright Zikula Foundation - http://zikula.org/
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zikula\UsersModule\ProfileModule;
13
14
use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface;
15
use Zikula\UsersModule\Entity\RepositoryInterface\UserRepositoryInterface;
16
17
class IdentityProfileModule implements ProfileModuleInterface
18
{
19
    /**
20
     * @var UserRepositoryInterface
21
     */
22
    private $userRepository;
23
24
    /**
25
     * @var CurrentUserApiInterface
26
     */
27
    private $currentUserApi;
28
29
    /**
30
     * IdentityProfileModule constructor.
31
     * @param UserRepositoryInterface $userRepository
32
     * @param CurrentUserApiInterface $currentUserApi
33
     */
34
    public function __construct(UserRepositoryInterface $userRepository, CurrentUserApiInterface $currentUserApi)
35
    {
36
        $this->userRepository = $userRepository;
37
        $this->currentUserApi = $currentUserApi;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getDisplayName($uid = null)
44
    {
45
        if (!isset($uid)) {
46
            return $this->currentUserApi->get('uname');
47
        }
48
49
        return $this->userRepository->find($uid)->getUname();
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getProfileUrl($uid = null)
56
    {
57
        return '#';
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function getAvatar($uid = null, array $parameters = [])
64
    {
65
        return '';
66
    }
67
}
68