Completed
Push — master ( a378d5...7b6893 )
by Flo
28s
created

EndBlock   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 1
1
<?php
2
/**
3
 * Class EndBlock | EndBlock.php
4
 * @package Faulancer\View\Helper
5
 * @author  Florian Knapp <[email protected]>
6
 */
7
namespace Faulancer\View\Helper;
8
9
use Faulancer\View\ViewController;
10
11
/**
12
 * Class EndBlock
13
 */
14
class EndBlock
15
{
16
17
    /**
18
     * Block closing handler
19
     *
20
     * @param ViewController $view
21
     * @param string         $name
22
     */
23
    public function __invoke(ViewController $view, string $name = '')
24
    {
25
        $content = ob_get_contents();
26
        $view->getParentTemplate()->setVariable($name, $content);
27
28
        unset($this->blockName);
29
        unset($this->blockContent);
30
31
        ob_end_clean();
32
    }
33
34
}