Completed
Push — master ( ea1c65...21d763 )
by Askupa
01:25
created

Popup::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Amarkal\Shortcode;
4
5
class Popup
6
{
7
    /**
8
     * Popup configuration array
9
     *
10
     * @var array
11
     */
12
    private $config = array();
13
    
14
    /**
15
     * Constructor
16
     *
17
     * @param array $config
18
     */
19
    public function __construct(array $config = array()) 
20
    {
21
        $this->config = $config;
22
    }
23
24
    /**
25
     * Get a configuration argument by name
26
     *
27
     * @param string $name
28
     * @return void
29
     */
30
    public function __get( $name )
31
    {
32
        if(isset($this->config[$name]))
33
        {
34
            return $this->config[$name];
35
        }
36
    }
37
    
38
    /**
39
     * Render the popup
40
     *
41
     * @return void
42
     */
43
    public function render()
44
    {
45
        ob_start();
46
        include 'Popup.phtml';
47
        return ob_get_clean();
48
    }
49
}