Gravatar   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A gravatar() 0 9 1
1
<?php
2
3
namespace mQueue\View\Helper;
4
5
use mQueue\Model\User;
6
use Zend_View_Helper_HtmlElement;
7
8
class Gravatar extends Zend_View_Helper_HtmlElement
9
{
10
    /**
11
     * Return a span with CSS class for a user on gravatar
12
     *
13
     * @param User $user
14
     * @param string $size small|medium|big
15
     *
16
     * @return string
17
     */
18 1
    public function gravatar(User $user, $size = 'small'): string
19
    {
20
        $attribs = [
21 1
            'class' => 'gravatar user_' . $user->id . ' ' . $size,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on mQueue\Model\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
22 1
            'title' => $user->nickname,
0 ignored issues
show
Bug Best Practice introduced by
The property nickname does not exist on mQueue\Model\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
23
        ];
24 1
        $result = '<span' . $this->_htmlAttribs($attribs) . '"></span>';
25
26 1
        return $result;
27
    }
28
}
29