Completed
Pull Request — master (#86)
by Vladimir
31:16
created

CompilerPostRenderStaticPageView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPageView() 0 4 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Event;
9
10
use allejo\stakx\Document\StaticPageView;
11
use Symfony\Component\EventDispatcher\Event;
12
13
/**
14
 * This event is triggered after a Static PageView is compiled and before it is written to a file. The compiled output
15
 * is accessible and can be modified before it is written out to a file.
16
 *
17
 * @since 0.2.0
18
 */
19
class CompilerPostRenderStaticPageView extends Event
20
{
21
    use CompilerPostRenderTrait;
22
23
    const NAME = 'compiler.postrender.static_pageview';
24
25
    private $pageView;
26
27
    /**
28
     * @param string $compiledOutput
29
     */
30 10
    public function __construct(StaticPageView $pageView, $compiledOutput)
31
    {
32 10
        $this->pageView = $pageView;
33 10
        $this->compiledOutput = $compiledOutput;
34 10
    }
35
36
    public function getPageView()
37
    {
38
        return clone $this->pageView;
39
    }
40
}
41