Passed
Push — master ( 6d9d43...921f98 )
by Alain
02:46
created

NullView::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
ccs 3
cts 4
cp 0.75
rs 9.4285
cc 2
eloc 3
nc 2
nop 2
crap 2.0625
1
<?php
2
/**
3
 * Bright Nucleus View Component.
4
 *
5
 * @package   BrightNucleus\View
6
 * @author    Alain Schlesser <[email protected]>
7
 * @license   MIT
8
 * @link      http://www.brightnucleus.com/
9
 * @copyright 2016 Alain Schlesser, Bright Nucleus
10
 */
11
12
namespace BrightNucleus\View\View;
13
14
use BrightNucleus\View\Support\NullObject;
15
16
/**
17
 * Class NullView.
18
 *
19
 * @since   0.1.0
20
 *
21
 * @package BrightNucleus\View\View
22
 * @author  Alain Schlesser <[email protected]>
23
 */
24
class NullView implements ViewInterface, NullObject
25
{
26
27
    /**
28
     * Render the view.
29
     *
30
     * @since 0.1.0
31
     *
32
     * @param array $context Optional. The context in which to render the view.
33
     * @param bool  $echo    Optional. Whether to echo the output immediately. Defaults to false.
34
     *
35
     * @return string|void Rendered HTML or nothing, depending on $echo argument.
36
     */
37 1
    public function render(array $context = [], $echo = false)
38
    {
39 1
        if (! $echo) {
40 1
            return '';
41
        }
42
    }
43
}
44