Completed
Branch develop (e3a612)
by Patryk
10:42 queued 45s
created

IframelyDTO   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMeta() 0 4 1
A getLinks() 0 4 1
A getHtml() 0 4 1
1
<?php
2
3
namespace KaLLoSz\Twig\Extension;
4
5
/**
6
 * Class IframelyDTO
7
 * @package KaLLoSz\Twig\Extension
8
 *
9
 * @author Patryk Kala <[email protected]>
10
 */
11
class IframelyDTO
12
{
13
    /**
14
     * @var array
15
     */
16
    protected $data;
17
18
    /**
19
     * Build IframelyDTO object base on iframely schema
20
     * (http://iframe.ly/api/iframely?url=http://iframe.ly/ACcM3Y)
21
     *
22
     * @param array $data
23
     */
24
    public function __construct(array $data)
25
    {
26
        $this->data = $data;
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function getMeta(): array
33
    {
34
        return $this->data['meta'];
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getLinks(): array
41
    {
42
        return $this->data['links'];
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getHtml(): string
49
    {
50
        return $this->data['html'];
51
    }
52
}
53