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

Popup   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __get() 0 7 2
A render() 0 6 1
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
}