EndBlock   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

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