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 — develop ( dcc989...a7f839 )
by Tom Van
43s
created

AbstractCollection::count()   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
 * Abstract implementation of a Collection
4
 *
5
 * @link        http://github.com/PHPExif/php-exif-common for the canonical source repository
6
 * @copyright   Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
7
 * @license     http://github.com/PHPExif/php-exif-common/blob/master/LICENSE MIT License
8
 * @category    PHPExif
9
 * @package     Common
10
 * @codeCoverageIgnore
11
 */
12
13
namespace PHPExif\Common\Collection;
14
15
use PHPExif\Common\Exception\Collection\ElementAlreadyExistsException;
16
use PHPExif\Common\Exception\Collection\ElementNotExistsException;
17
18
/**
19
 * AbstractCollection class
20
 *
21
 * @category    PHPExif
22
 * @package     Common
23
 */
24
abstract class AbstractCollection implements Collection
25
{
26
    /**
27
     * Holds the entries of the collection
28
     *
29
     * @var array
30
     */
31
    private $elements;
32
33
    /**
34
     * Collection constructor
35
     *
36
     * @param array $data
0 ignored issues
show
Bug introduced by
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     */
38
    public function __construct(array $elements = array())
39
    {
40
        $this->elements = array();
41
42
        foreach ($elements as $name => $config) {
43
            $this->add($name, $config);
44
        }
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function add($key, $value)
51
    {
52
        if ($this->exists($key)) {
53
            throw ElementAlreadyExistsException::withKey($key);
54
        }
55
56
        $this->elements[$key] = $value;
57
58
        return $this;
59
    }
60
61
    /**
62
     * @inheritDoc
63
     */
64
    public function exists($key)
65
    {
66
        return array_key_exists($key, $this->elements);
67
    }
68
69
    /**
70
     * @inheritDoc
71
     */
72
    public function get($key)
73
    {
74
        if (!$this->exists($key)) {
75
            throw ElementNotExistsException::withKey($key);
76
        }
77
78
        return $this->elements[$key];
79
    }
80
81
    /**
82
     * @inheritDoc
83
     */
84
    public function count()
85
    {
86
        return count($this->elements);
87
    }
88
}
89