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.

MessageCollection::getMessageCollection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Zbox\UnifiedPush\Message;
4
5
/**
6
 * Class MessageCollection
7
 * @package Zbox\UnifiedPush\Message
8
 */
9
class MessageCollection
10
{
11
    /**
12
     * @var \ArrayIterator
13
     */
14
    protected $messageCollection;
15
16
    /**
17
     * @param array $messages
18
     */
19
    public function __construct(array $messages = array())
20
    {
21
        $this->messageCollection = new \ArrayIterator();
22
23
        foreach ($messages as $message) {
24
            $this->addMessage($message);
25
        }
26
    }
27
28
    /**
29
     * @param MessageInterface $message
30
     * @return $this
31
     */
32
    public function addMessage(MessageInterface $message)
33
    {
34
        $this->messageCollection->append($message);
35
        return $this;
36
    }
37
38
    /**
39
     * @return \ArrayIterator
40
     */
41
    public function getMessageCollection()
42
    {
43
        $this->messageCollection->rewind();
44
45
        return $this->messageCollection;
46
    }
47
}
48