DictionaryResponse::getEntries()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GinoPane\PHPolyglot\API\Response\Dictionary;
4
5
use GinoPane\PHPolyglot\API\Response\ApiResponseAbstract;
6
use GinoPane\PHPolyglot\API\Response\Dictionary\Entry\DictionaryEntry;
7
8
/**
9
 * Class DictionaryResponse
10
 *
11
 * @author Sergey <Gino Pane> Karavay
12
 */
13
class DictionaryResponse extends ApiResponseAbstract
14
{
15
    /**
16
     * @var DictionaryEntry[]
17
     */
18
    protected $data;
19
20
    /**
21
     * @param DictionaryEntry $entry
22
     *
23
     * @return DictionaryResponse
24
     */
25
    public function addEntry(DictionaryEntry $entry): DictionaryResponse
26
    {
27
        $this->data[] = $entry;
28
29
        return $this;
30
    }
31
32
    /**
33
     * Returns an array of saved entries
34
     *
35
     * @return DictionaryEntry[]
36
     */
37
    public function getEntries()
38
    {
39
        return (array)parent::getData();
40
    }
41
}
42