Collection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 31
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A hasPagination() 0 3 1
A getIterator() 0 3 1
A getPagination() 0 3 1
1
<?php
2
namespace ElevenLabs\Api\Service\Resource;
3
4
use ElevenLabs\Api\Service\Pagination\Pagination;
5
6
class Collection extends Item implements \IteratorAggregate
7
{
8
    /**
9
     * @var Pagination|null
10
     */
11
    protected $pagination;
12
13
    /**
14
     * @param array $data
15
     * @param array $meta
16
     * @param Pagination|null $pagination
17
     */
18 6
    public function __construct(array $data, array $meta, Pagination $pagination = null)
19
    {
20 6
        parent::__construct($data, $meta);
21 6
        $this->pagination = $pagination;
22 6
    }
23
24 1
    public function getIterator()
25
    {
26 1
        return new \ArrayIterator($this->getData());
27
    }
28
29 1
    public function hasPagination()
30
    {
31 1
        return ($this->pagination !== null);
32
    }
33
34 2
    public function getPagination()
35
    {
36 2
        return $this->pagination;
37
    }
38
}
39