Completed
Pull Request — master (#7)
by Nick
14:05
created

CapturesResponse::getMatchedSegments()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace Acquia\LiftClient\Entity;
4
5
class CapturesResponse extends CapturesBase
6
{
7
    /**
8
     * Gets the 'error' parameter.
9
     *
10
     * @return string
11
     */
12
    public function getError()
13
    {
14
        return $this->getEntityValue('error', '');
15
    }
16
17
    /**
18
     * Gets the 'matched_segments' parameter.
19
     *
20
     * @return Segment[]
21
     */
22
    public function getMatchedSegments()
23
    {
24
        $ret = [];
25
        $segments = $this->getEntityValue('matched_segments', []);
26
        foreach ($segments as $segment) {
27
            $ret[] = new Segment($segment);
28
        }
29
30
        return $ret;
31
    }
32
}
33