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 — master ( 5ac723...c719eb )
by Stan
07:02
created

UserProfilePhotos   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 2
dl 0
loc 57
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTotalCount() 0 4 1
A setTotalCount() 0 4 1
A setPhotos() 0 14 3
A getPhotos() 0 4 1
A getPhotoByOffset() 0 4 3
1
<?php
2
3
namespace Teebot\Api\Entity;
4
5
class UserProfilePhotos extends AbstractEntity
6
{
7
    const ENTITY_TYPE   = 'UserProfilePhotos';
8
9
    protected $total_count;
10
11
    protected $photos;
12
13
    /**
14
     * @return mixed
15
     */
16
    public function getTotalCount()
17
    {
18
        return $this->total_count;
19
    }
20
21
    /**
22
     * @param mixed $total_count
23
     */
24
    public function setTotalCount($total_count)
25
    {
26
        $this->total_count = $total_count;
27
    }
28
29
    /**
30
     * @param array $photos
31
     *
32
     * @return $this
33
     */
34
    public function setPhotos($photos)
35
    {
36
        $this->photos = $photos;
37
38
        if (is_array($photos)) {
39
            $this->photos = [];
40
41
            foreach ($photos as $photo) {
42
                $this->photos[] = new PhotoSizeArray($photo);
43
            }
44
        }
45
46
        return $this;
47
    }
48
49
    /**
50
     * @return mixed
51
     */
52
    public function getPhotos()
53
    {
54
        return $this->photos;
55
    }
56
57
    public function getPhotoByOffset($offset = 0)
58
    {
59
        return is_array($this->photos) && isset($this->photos[$offset]) ? $this->photos[0] : null;
60
    }
61
}