ComicDataContainer::get()   A
last analyzed

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 1
1
<?php declare(strict_types = 1);
2
3
namespace ikoene\Marvel\DataContainer;
4
5
use ikoene\Marvel\Entity\Comic;
6
7
/**
8
 * Class ComicDataContainer
9
 * @package ikoene\Marvel\DataContainer
10
 */
11
class ComicDataContainer extends AbstractDataContainer
12
{
13
    /**
14
     * The list of comics returned by the call
15
     *
16
     * @var array
17
     */
18
    private $results;
19
20
    /**
21
     * Gets one specific result
22
     *
23
     * @param $key
24
     *
25
     * @return Character
26
     */
27
    public function get($key)
28
    {
29
        return $this->results[$key];
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function getResults()
36
    {
37
        return $this->results;
38
    }
39
40
    /**
41
     * @param $item
42
     */
43
    public function addResult(Comic $item)
44
    {
45
        $this->results[] = $item;
46
    }
47
}
48