Completed
Push — master ( 22c257...e714e6 )
by Gabriel
13:14 queued 10:09
created

XML::instance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Nip\View;
4
5
use Nip\View;
6
7
class XML extends View
8
{
9
    public function load($view = false, $variables = array(), $return = false)
10
    {
11
        header('Content-type: text/xml');
12
        return parent::load($view, $variables, $return);
13
    }
14
15
    /**
16
     * Singleton
17
     *
18
     * @return self
19
     */
20
    public static function instance()
21
    {
22
        static $instance;
23
        if (!($instance instanceof self)) {
24
            $instance = new self();
25
        }
26
        return $instance;
27
    }
28
}
29