Completed
Pull Request — master (#86)
by Vladimir
38:05 queued 09:07
created

CompilerPostRenderRepeaterPageView::getPageView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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\RepeaterPageView;
11
use allejo\stakx\FrontMatter\ExpandedValue;
12
use Symfony\Component\EventDispatcher\Event;
13
14
/**
15
 * This event is triggered after a Repeater PageView is compiled and before it is written to a file. The compiled output
16
 * is accessible and can be modified before it is written out to a file.
17
 *
18
 * @since 0.2.0
19
 */
20 View Code Duplication
class CompilerPostRenderRepeaterPageView extends Event
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    use CompilerPostRenderTrait;
23
24
    const NAME = 'compiler.postrender.repeater_pageview';
25
26
    private $pageView;
27
    private $expandedValue;
28
29
    /**
30
     * @param string $compiledOutput
31
     */
32 3
    public function __construct(RepeaterPageView $pageView, ExpandedValue $expandedValue, $compiledOutput)
33
    {
34 3
        $this->pageView = $pageView;
35 3
        $this->expandedValue = $expandedValue;
36 3
        $this->compiledOutput = $compiledOutput;
37 3
    }
38
39
    public function getPageView()
40
    {
41
        return clone $this->pageView;
42
    }
43
44
    public function getExpandedValue()
45
    {
46
        return clone $this->expandedValue;
47
    }
48
}
49