GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — analysis-XZEV6g ( fb6100 )
by butschster
16:20
created

Gravatar   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 70
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setRating() 0 5 1
A getSize() 0 3 1
A getRating() 0 3 1
A toArray() 0 12 2
A setSize() 0 5 1
1
<?php
2
3
namespace SleepingOwl\Admin\Display\Column;
4
5
class Gravatar extends NamedColumn
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $size = '40';
11
12
    /** @var string */
13
    protected $rating = 'pg';
14
15
    /**
16
     * @var string
17
     */
18
    protected $view = 'column.gravatar';
19
20
    /**
21
     * @return string
22
     */
23
    public function getSize()
24
    {
25
        return $this->size;
26
    }
27
28
    /**
29
     * @param string $size
30
     *
31
     * @return $this
32
     */
33
    public function setSize($size)
34
    {
35
        $this->size = $size;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getRating()
44
    {
45
        return $this->rating;
46
    }
47
48
    /**
49
     * @param string $rating
50
     *
51
     * @return $this
52
     */
53
    public function setRating($rating)
54
    {
55
        $this->rating = $rating;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return array
62
     */
63
    public function toArray()
64
    {
65
        $value = $this->getModelValue();
66
        if (! empty($value)) {
67
            $value = md5(strtolower(trim($value))).'?';
68
        } else {
69
            $value = '205e460b479e2e5b48aec07710c08d50?f=y';
70
        }
71
72
        return parent::toArray() + [
73
                'value' => sprintf('https://www.gravatar.com/avatar/%s&size=%s&rating=%s', $value, $this->size,
74
                    $this->rating),
75
            ];
76
    }
77
}
78