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 — feature/tweak ( 28e05b )
by jake
02:03
created

Messenger::getIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Molniya Messenger
4
 *
5
 * PHP version 5
6
 *
7
 * Copyright (C) 2017 Jake Johns
8
 *
9
 * This software may be modified and distributed under the terms
10
 * of the MIT license.  See the LICENSE file for details.
11
 *
12
 * @category  Trait
13
 * @package   Jnjxp\Molniya
14
 * @author    Jake Johns <[email protected]>
15
 * @copyright 2017 Jake Johns
16
 * @license   http://jnj.mit-license.org/2017 MIT License
17
 * @link      https://github.com/jnjxp/jnjxp.molniya
18
 */
19
20
namespace Jnjxp\Molniya\Messenger;
21
22
use ArrayIterator;
23
use IteratorAggregate;
24
25
/**
26
 * Messenger
27
 *
28
 * @category Messenger
29
 * @package  Jnjxp\Molniya
30
 * @author   Jake Johns <[email protected]>
31
 * @license  https://jnj.mit-license.org/ MIT License
32
 * @link     https://github.com/jnjxp/jnjxp.molniya
33
 *
34
 * @see MessengerInterface
35
 */
36
class Messenger implements IteratorAggregate, MessengerInterface
37
{
38
    use MessengerTrait;
39
40
    /**
41
     * Messages
42
     *
43
     * @var array
44
     *
45
     * @access protected
46
     */
47
    protected $messages = [];
48
49
    /**
50
     * Add a message
51
     *
52
     * @param MessageInterface $message DESCRIPTION
53
     *
54
     * @return void
55
     *
56
     * @access public
57
     */
58
    public function addMessage(Message\MessageInterface $message) : void
59
    {
60
        $this->messages[] = $message;
61
    }
62
63
    /**
64
     * Count
65
     *
66
     * @return mixed
67
     *
68
     * @access public
69
     */
70
    public function count() : int
71
    {
72
        return count($this->messages);
73
    }
74
75
    /**
76
     * Get Iterator
77
     *
78
     * @return ArrayIterator
79
     *
80
     * @access public
81
     */
82
    public function getIterator() : ArrayIterator
83
    {
84
        return new ArrayIterator($this->messages);
85
    }
86
}
87